/**
 * 标准化响应式样式表
 * 用于优化网站在不同设备上的显示效果
 */

/* 平板设备 (768px 及以上) */
@media (min-width: 768px) {
  .container {
    max-width: 750px;
  }
  
  .navbar-brand {
    font-size: 1.75rem;
    /* 添加主题过渡 */
    transition: color 0.3s ease, font-size 0.3s ease;
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
    /* 添加主题过渡 */
    transition: color 0.3s ease, font-size 0.3s ease;
  }
  
  .hero-content p {
    font-size: 1.25rem;
    /* 添加主题过渡 */
    transition: color 0.3s ease, font-size 0.3s ease;
  }
  
  .product-card .product-name {
    font-size: 1.1rem;
    /* 添加主题过渡 */
    transition: color 0.3s ease, font-size 0.3s ease;
  }
  
  /* 导航栏优化 */
  .navbar-nav .nav-link {
    padding: 0.75rem 1.25rem;
    /* 添加主题过渡 */
    transition: color 0.3s ease, background-color 0.3s ease, padding 0.3s ease;
  }
  
  .dropdown-menu {
    margin-top: 0;
  }
  
  /* 产品网格优化 */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  /* 解决方案卡片优化 */
  .solution-card {
    flex: 0 0 calc(50% - 1rem);
  }
}

/* 中等桌面设备 (992px 及以上) */
@media (min-width: 992px) {
  .container {
    max-width: 970px;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1.25rem;
  }
  
  .hero-content h1 {
    font-size: 3rem;
  }
  
  .hero-content p {
    font-size: 1.35rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .solution-card {
    flex: 0 0 calc(50% - 1rem);
  }
  
  /* 导航栏优化 */
  .navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  .navbar-nav .nav-link::before {
    display: block;
  }
  
  /* 购物车页面优化 */
  .cart-item-image {
    max-width: 80px;
    height: 80px;
  }
}

/* 大型桌面设备 (1200px 及以上) */
@media (min-width: 1200px) {
  .container {
    max-width: 1170px;
  }
  
  .hero-content h1 {
    font-size: 3.5rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .solution-card {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

/* 超大屏幕设备 */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  
  .hero-content h1 {
    font-size: 4rem;
  }
  
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 小屏幕设备优化 */
@media (max-width: 576px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .hero-content {
    padding: 1rem;
  }
  
  .hero-content h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
  }
  
  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .product-card .product-image {
    height: 200px;
  }
  
  .solution-card {
    flex: 0 0 100%;
  }
  
  .footer-heading {
    font-size: 1.1rem;
  }
  
  .social-icon {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
  }
  
  /* 移动端导航栏优化 */
  .navbar {
    padding: 0.5rem 1rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border-radius: 8px;
  }
  
  .navbar-nav .nav-link::before {
    display: none;
  }
  
  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
  }
  
  .offcanvas {
    width: 280px;
  }
  
  /* 表单元素优化 */
  .form-control,
  .form-select {
    min-height: 44px;
  }
  
  /* 下拉菜单优化 */
  .dropdown-item {
    padding: 0.75rem 1rem;
  }
}

/* 超小屏幕设备 (400px 以下) */
@media (max-width: 400px) {
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .hero-content h1 {
    font-size: 1.5rem;
  }
  
  .product-card .product-image {
    height: 150px;
  }
  
  .footer-links a,
  .footer-contact li {
    font-size: 0.85rem;
  }
  
  /* 移动端导航栏优化 */
  .navbar {
    padding: 0.4rem 0.75rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  
  /* 按钮优化 */
  .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
  
  /* 表单元素优化 */
  .form-control,
  .form-select {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .navbar-brand img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  .product-card .product-image img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
  .navbar {
    padding: 0.25rem 1rem;
  }
  
  .hero-section {
    height: 70vh;
  }
  
  /* 横屏模式下优化导航栏 */
  .navbar-nav .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* 打印样式 */
@media print {
  .navbar,
  .footer-custom,
  .chat-widget,
  .btn {
    display: none !important;
  }
  
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .product-details {
    box-shadow: none !important;
    border: 1px solid #000 !important;
  }
  
  /* 确保打印时文字清晰 */
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
  }
  
  h1, h2, h3, h4, h5, h6 {
    color: #000;
    page-break-after: avoid;
  }
  
  p {
    orphans: 3;
    widows: 3;
  }
  
  /* 表格打印优化 */
  table {
    border-collapse: collapse;
    width: 100%;
  }
  
  th, td {
    border: 1px solid #000;
    padding: 8px;
    text-align: left;
  }
  
  th {
    background-color: #f2f2f2;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除悬停效果，因为触摸设备没有悬停 */
  .btn:hover {
    transform: none;
  }
  
  .product-card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  .navbar-nav .nav-link:hover {
    transform: none;
    box-shadow: none;
  }
  
  .navbar-nav .nav-link:hover::before {
    width: 0;
  }
  
  /* 增大触摸目标 */
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  .carousel-control-prev,
  .carousel-control-next {
    min-width: 44px;
  }
  
  .carousel-indicators button {
    min-width: 12px;
    min-height: 12px;
  }
}

/* 网络连接较慢时的优化 */
@media (max-width: 768px) {
  /* 降低图片质量以加快加载速度 */
  img {
    transform: translateZ(0);
    perspective: 1000;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    -webkit-perspective: 1000;
    -webkit-backface-visibility: hidden;
  }
  
  /* 减少动画效果以提高性能 */
  .hero-title,
  .hero-description,
  .hero-button {
    animation-duration: 0.5s;
  }
  
  /* 简化复杂效果 */
  .card {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  
  .card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  }
  
  /* 禁用复杂背景 */
  .hero-content {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(0);
  }
}

/* 统一过渡效果 */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}