/* ========================================
   数慧时空世界大模型 - 响应式设计
   ======================================== */

/* === 大屏优化 (1400px+) === */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .ai-brain-container {
    width: 520px;
    height: 520px;
  }
}

/* === 平板端 (1024px以下) === */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }
  
  .hero-content {
    order: 1;
  }
  
  .hero-visual {
    order: 0;
  }
  
  .ai-brain-container {
    width: 350px;
    height: 350px;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  
  .stat-item::after { display: none; }
  
  .product-main {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .product-visual {
    min-height: 300px;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .testimonial-card {
    flex: 0 0 calc(50% - 14px);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
  
  .detail-layout {
    grid-template-columns: 1fr;
  }
  
  .detail-sidebar {
    position: static;
  }
}

/* === 手机端 (768px以下) === */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  /* 导航 */
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 32px 40px;
    gap: 24px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(108,99,255,0.1);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  
  .nav-links.open {
    right: 0;
  }
  
  .nav-links a {
    font-size: 1.15rem;
  }
  
  .mobile-menu-btn {
    display: flex;
    z-index: 1001;
  }
  
  .mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  
  /* 遮罩 */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 998;
  }
  
  .nav-overlay.active {
    display: block;
  }
  
  /* Hero */
  .hero {
    min-height: auto;
    padding-top: 100px;
  }
  
  .hero .container {
    padding-top: 60px;
    padding-bottom: 60px;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1.05rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn {
    justify-content: center;
    padding: 16px 28px;
  }
  
  .ai-brain-container {
    width: 280px;
    height: 280px;
  }
  
  .ai-core-center {
    width: 140px;
    height: 140px;
  }
  
  .node {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  
  /* Sections */
  .section-title {
    font-size: 1.8rem;
  }
  
  .features-grid,
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .feature-card {
    padding: 28px;
  }
  
  /* 统计数据 */
  .stats-section {
    padding: 60px 0;
  }
  
  .stat-number {
    font-size: 2.2rem;
  }
  
  /* Tab切换 */
  .product-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;
    margin-left: calc(-1 * var(--container-padding, 24px));
    padding-left: var(--container-padding, 24px);
    padding-right: var(--container-padding, 24px);
  }
  
  .product-tabs::-webkit-scrollbar {
    display: none;
  }
  
  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
  }
  
  .filter-group {
    flex-wrap: wrap;
  }
  
  .search-box input {
    width: 100%;
  }
  
  .search-box input:focus {
    width: 100%;
  }
  
  /* Testimonials */
  .testimonials-section {
    padding: 80px 0;
    overflow-x: hidden;
  }
  
  .testimonials-track {
    display: block;
  }
  
  .testimonial-card {
    flex: none !important;
    width: 100% !important;
  }
  
  .testimonial-card:not(:last-child) {
    margin-bottom: 20px;
  }
  
  /* CTA */
  .cta-box {
    padding: 48px 24px;
  }
  
  .cta-title {
    font-size: 1.8rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  /* Page header */
  .page-header {
    padding: 120px 0 60px;
  }
  
  .page-title {
    font-size: 2rem;
  }
  
  /* Detail page */
  .detail-layout {
    gap: 24px;
    padding: 40px 0 60px;
  }
  
  .gallery-thumbs {
    display: none;
  }
  
  /* Partners */
  .partners-grid {
    gap: 30px;
  }
}

/* === 小屏手机 (480px以下) === */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .hero-title {
    font-size: 1.85rem;
  }
  
  .logo-text {
    font-size: 1.2rem;
  }
  
  .stat-item {
    padding: 20px 12px;
  }
  
  .stat-number {
    font-size: 1.8rem;
  }
  
  .tab-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
  
  .card-image {
    height: 160px;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}

/* === 减少动画偏好支持 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .fade-in-up,
  .fade-in-down,
  .fade-in-left,
  .fade-in-right,
  .scale-in {
    opacity: 1;
    transform: none;
  }
  
  .stagger-children > * {
    opacity: 1;
    transform: none;
  }
}

/* === 打印样式 === */
@media print {
  body::before,
  .navbar,
  .back-to-top,
  .scroll-indicator,
  .page-loader {
    display: none !important;
  }
  
  body {
    color: #000;
    background: #fff;
  }
  
  section {
    break-inside: avoid;
  }
}
