/**
 * 响应式样式文件
 * 用于移动端响应式优化
 * 断点：768px（移动端 vs 桌面端）
 */

/* ============================================
   基础响应式设置
   ============================================ */

/* 移动端基础样式（默认） */
@media (max-width: 767px) {
  /* 基础字体和可读性优化 */
  html {
    font-size: 16px;
  }

  body {
    line-height: 1.6;
  }

  /* 容器适配 */
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* 桌面端样式 */
@media (min-width: 768px) {
  /* 保持原有桌面端样式 */
}

/* ============================================
   Hero Section 响应式样式
   ============================================ */

/* 移动端 Hero Section 样式 */
@media (max-width: 767px) {
  .hero {
    padding: 25px 20px;
    min-height: 180px;
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-description {
    font-size: 0.85rem;
  }
}

/* 桌面端 Hero Section 样式（保持原有样式） */
@media (min-width: 768px) {
  .hero {
    padding: 80px 20px;
    min-height: 400px;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }
}

/* ============================================
   产品卡片响应式样式
   ============================================ */

/* 移动端产品卡片样式 */
@media (max-width: 767px) {
  /* 产品网格改为单列布局 */
  .product-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* 产品卡片样式调整 */
  .product-card {
    padding: 20px;
    width: 100%;
  }

  /* 产品图标尺寸调整 */
  .product-icon {
    font-size: 2rem;
  }

  /* 产品标题尺寸调整 */
  .product-card h3 {
    font-size: 1.2rem;
  }

  /* 产品描述文字调整 */
  .product-card p {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  /* 按钮布局优化为垂直排列 */
  .product-links {
    flex-direction: column;
    gap: 12px;
  }

  /* 按钮样式优化 */
  .product-links .btn {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  /* 主按钮样式 */
  .product-links .btn-primary {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
    color: white;
    border: none;
  }

  .product-links .btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  }

  /* 次要按钮样式 */
  .product-links .btn-secondary {
    background: white;
    color: #1565C0;
    border: 2px solid #1565C0;
    box-shadow: 0 2px 4px rgba(21, 101, 192, 0.1);
  }

  .product-links .btn-secondary:active {
    transform: scale(0.98);
    background: #f0f9ff;
    box-shadow: 0 1px 2px rgba(21, 101, 192, 0.2);
  }

  /* 特性标签调整 */
  .feature-tag {
    font-size: 0.85rem;
    padding: 5px 10px;
  }
}

/* 桌面端产品卡片样式（保持原有样式） */
@media (min-width: 768px) {
  /* 保持多列网格布局 */
  .product-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
  }

  /* 保持原有卡片样式 */
  .product-card {
    padding: 25px;
  }

  /* 保持原有图标尺寸 */
  .product-icon {
    font-size: 2.2rem;
  }

  /* 保持原有标题尺寸 */
  .product-card h3 {
    font-size: 1.4rem;
  }

  /* 保持原有按钮布局 */
  .product-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
}

/* ============================================
   触摸交互优化样式
   ============================================ */

/* 触摸激活状态样式 */
.touch-active {
  opacity: 0.7;
  transform: scale(0.98);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* 移动端触摸优化 */
@media (max-width: 767px) {
  /* 确保按钮和链接有最小触摸区域 */
  .touch-optimized,
  .btn,
  button,
  .nav-link,
  a.btn-primary,
  a.btn-secondary {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
  }

  /* 移动端元素间距增加 */
  .mobile-spacing {
    gap: 15px !important;
  }

  .mobile-spacing > * {
    margin-bottom: 12px;
  }

  .mobile-spacing > *:last-child {
    margin-bottom: 0;
  }

  /* 移动端表单输入框优化 */
  .mobile-input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea,
  select {
    min-height: 44px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
    padding: 12px 15px;
  }

  textarea.mobile-input {
    min-height: 100px;
  }

  /* 移动端按钮样式优化 */
  .btn {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 8px;
  }

  /* 产品卡片触摸区域优化 */
  .product-card {
    padding: 24px;
    min-height: 44px;
  }

  /* 导航链接触摸区域优化 */
  .nav-link {
    padding: 14px 20px;
    display: block;
  }
}

/* 移除移动端悬停效果 */
@media (max-width: 767px) {
  /* 为触摸设备禁用 hover 效果 */
  .touch-device .btn:hover,
  .touch-device button:hover,
  .touch-device .nav-link:hover,
  .touch-device .product-card:hover {
    transform: none;
    box-shadow: inherit;
  }

  /* 使用触摸激活状态替代 hover */
  .touch-device .btn.touch-active,
  .touch-device button.touch-active,
  .touch-device .nav-link.touch-active,
  .touch-device .product-card.touch-active {
    opacity: 0.8;
    transform: scale(0.98);
  }

  /* 禁用所有 hover 过渡效果 */
  .touch-device * {
    -webkit-tap-highlight-color: transparent;
  }
}

/* 桌面端保持原有 hover 效果 */
@media (min-width: 768px) {
  /* 桌面端不应用触摸优化 */
  .touch-optimized {
    min-width: auto;
    min-height: auto;
  }

  /* 桌面端保持原有间距 */
  .mobile-spacing {
    gap: inherit;
  }

  .mobile-spacing > * {
    margin-bottom: 0;
  }
}

/* ============================================
   响应式工具类
   ============================================ */

/* 移动端显示/隐藏 */
.mobile-only {
  display: none;
}

@media (max-width: 767px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }
}

/* 桌面端显示/隐藏 */
@media (min-width: 768px) {
  .desktop-only {
    display: block;
  }

  .mobile-only {
    display: none;
  }
}
