/* ============================================
   公子鱼科技 - 响应式适配
   ============================================ */

/* ============================================
   断点定义
   - Mobile: < 640px
   - Tablet: 640px - 1023px
   - Desktop: 1024px - 1279px
   - Large: >= 1280px
   ============================================ */

/* ============================================
   大屏优化 (>= 1280px)
   ============================================ */
@media (min-width: 1280px) {
  .section-title {
    font-size: var(--text-5xl);
  }

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

/* ============================================
   桌面端适配 (1024px - 1279px)
   ============================================ */
@media (max-width: 1279px) {
  :root {
    --section-padding-y: 5rem;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-8);
  }
}

/* ============================================
   平板适配 (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
  :root {
    --section-padding-y: 4rem;
    --header-height: 64px;
  }

  /* 导航菜单变为侧滑 */
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    padding: var(--space-8);
    gap: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--duration-normal) var(--ease-default);
    border-top: 1px solid var(--border-light);
  }

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

  .nav-link {
    font-size: var(--text-xl);
    padding: var(--space-4) 0;
  }

  .nav-link::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  /* 网格变为2列 */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* 页脚变为2列 */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: span 2;
    max-width: 100%;
  }

  /* Hero区域调整 */
  .hero-section {
    padding-top: calc(var(--header-height) + var(--space-16));
  }

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

  /* 卡片间距调整 */
  .service-card {
    padding: var(--space-6);
  }
}

/* ============================================
   移动端适配 (< 768px)
   ============================================ */
@media (max-width: 767px) {
  :root {
    --section-padding-y: 3rem;
    --container-padding: 1rem;
  }

  /* 字体大小调整 */
  .hero-title {
    font-size: var(--text-3xl);
    line-height: var(--leading-tight);
  }

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

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

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

  /* 网格变为1列 */
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  /* 按钮组垂直排列 */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
  }

  /* 页脚单列 */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: span 1;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  /* 服务卡片图标缩小 */
  .service-card-icon {
    width: 48px;
    height: 48px;
  }

  .service-card-icon svg {
    width: 24px;
    height: 24px;
  }

  /* 案例卡片全宽 */
  .case-card {
    margin-left: calc(var(--container-padding) * -1);
    margin-right: calc(var(--container-padding) * -1);
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* 统计数据垂直排列 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .stat-item {
    text-align: center;
  }

  /* 表单全宽 */
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  /* 导航栏 */
  .navbar {
    height: 60px;
  }

  .logo-text {
    font-size: var(--text-lg);
  }

  .logo img {
    width: 32px;
    height: 32px;
  }

  /* 页脚标题 */
  .footer-title {
    margin-bottom: var(--space-4);
  }

  /* 时间线垂直布局 */
  .timeline {
    padding-left: var(--space-8);
  }

  .timeline-item {
    padding-left: var(--space-6);
  }

  .timeline-item::before {
    left: -25px;
  }

  .timeline-line {
    left: 7px;
  }

  /* 团队成员卡片 */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 流程步骤 */
  .process-steps {
    flex-direction: column;
    gap: var(--space-8);
  }

  .process-step::after {
    display: none;
  }

  /* 联系信息卡片 */
  .contact-info-grid {
    grid-template-columns: 1fr;
  }

  /* 隐藏大装饰元素 */
  .glow-orb {
    opacity: 0.2;
  }

  .glow-orb-1 {
    width: 200px;
    height: 200px;
  }

  .glow-orb-2 {
    width: 150px;
    height: 150px;
  }
}

/* ============================================
   小屏移动端 (< 480px)
   ============================================ */
@media (max-width: 479px) {
  :root {
    --section-padding-y: 2.5rem;
  }

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

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

  /* 团队单列 */
  .team-grid {
    grid-template-columns: 1fr;
  }

  /* 统计数据单列 */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* 按钮全宽 */
  .btn {
    width: 100%;
  }

  /* 卡片内边距缩小 */
  .service-card {
    padding: var(--space-5);
  }

  .case-card-content {
    padding: var(--space-4);
  }

  /* 标签换行 */
  .case-card-tags {
    flex-wrap: wrap;
  }

  /* 导航菜单 */
  .nav-menu {
    padding: var(--space-6);
  }

  .nav-link {
    font-size: var(--text-lg);
  }

  /* 页脚社交图标 */
  .footer-social {
    justify-content: center;
  }
}

/* ============================================
   横屏适配
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--space-8));
    padding-bottom: var(--space-8);
  }

  .nav-menu {
    overflow-y: auto;
  }
}

/* ============================================
   触摸设备优化
   ============================================ */
@media (hover: none) {
  .service-card:hover,
  .case-card:hover {
    transform: none;
  }

  .btn:hover {
    transform: none;
  }

  .hover-lift:hover {
    transform: none;
  }
}

/* ============================================
   打印样式
   ============================================ */
@media print {
  .navbar,
  .footer,
  .btn,
  .menu-toggle {
    display: none !important;
  }

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

  .section {
    padding: 2rem 0 !important;
  }

  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* ============================================
   安全区域适配 (刘海屏等)
   ============================================ */
@supports (padding-top: env(safe-area-inset-top)) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--header-height) + env(safe-area-inset-top));
  }

  .nav-menu {
    top: calc(var(--header-height) + env(safe-area-inset-top));
  }

  .hero-section {
    padding-top: calc(var(--header-height) + env(safe-area-inset-top) + var(--space-16));
  }
}
