/* 移动端响应式优化样式 */

/* 基础移动端适配 */
@media (max-width: 768px) {
  /* 容器和布局优化 */
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* 导航栏移动端优化 */
  .ud-header {
    padding: 0.5rem 0;
  }
  
  .navbar-logo img {
    width: 120px !important;
    height: auto;
  }
  
  /* 移动端菜单优化 */
  #navbarCollapse {
    width: 100% !important;
    max-width: 280px;
    right: 1rem !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  }
  
  #navbarCollapse ul li a {
    padding: 0.75rem 0 !important;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  /* Banner区域移动端优化 */
  .banner {
    padding-top: 100px !important;
    padding-bottom: 60px !important;
    text-align: center;
  }
  
  .banner h1 {
    font-size: 28px !important;
    line-height: 1.3;
    margin-bottom: 1rem;
  }
  
  .banner p {
    font-size: 16px !important;
    width: 90% !important;
    margin: 0 auto 1.5rem;
  }
  
  .banner .btn {
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }
  
  .banner .btn a {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .banner .slogo {
    width: 100% !important;
    margin-top: 2rem;
  }
  
  .banner .slogo .item {
    margin: 0.5rem;
    flex: 0 0 auto;
  }
  
  .banner .slogo img {
    width: 35px !important;
  }
  
  /* 卡片和内容区域优化 */
  .wow {
    margin-bottom: 1.5rem;
  }
  
  /* 表格响应式 */
  table {
    font-size: 0.875rem;
  }
  
  table th,
  table td {
    padding: 0.5rem !important;
  }
  
  /* 图片响应式 */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* 按钮优化 */
  .btn,
  button,
  .inline-flex {
    min-height: 44px; /* 触摸友好的最小高度 */
  }
  
  /* 文字大小优化 */
  .text-sm {
    font-size: 0.875rem !important;
  }
  
  .text-base {
    font-size: 1rem !important;
  }
  
  .text-lg {
    font-size: 1.125rem !important;
  }
  
  .text-xl {
    font-size: 1.25rem !important;
  }
  
  .text-2xl {
    font-size: 1.5rem !important;
  }
  
  .text-3xl {
    font-size: 1.875rem !important;
  }
  
  .text-4xl {
    font-size: 2.25rem !important;
  }
  
  /* 间距优化 */
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  .mt-8 {
    margin-top: 1.5rem !important;
  }
  
  .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .py-8 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  /* 联系信息优化 */
  .tel {
    font-size: 1rem !important;
    margin-right: 0.5rem !important;
  }
  
  .tel img {
    width: 24px !important;
    height: 24px !important;
  }
}

/* 小屏手机优化 (iPhone SE等) */
@media (max-width: 480px) {
  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  .banner h1 {
    font-size: 24px !important;
  }
  
  .banner p {
    font-size: 14px !important;
    width: 95% !important;
  }
  
  .banner .btn a {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .navbar-logo img {
    width: 100px !important;
  }
  
  #navbarCollapse {
    width: calc(100vw - 2rem) !important;
    max-width: none;
    left: 1rem !important;
    right: 1rem !important;
  }
  
  .text-3xl {
    font-size: 1.5rem !important;
  }
  
  .text-4xl {
    font-size: 1.75rem !important;
  }
  
  .tel {
    font-size: 0.875rem !important;
  }
}

/* 平板设备优化 */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .banner h1 {
    font-size: 36px;
  }
  
  .banner p {
    font-size: 17px;
    width: 70%;
  }
  
  .banner .btn {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 增大可点击区域 */
  a, button, .clickable {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* 移除hover效果 */
  .hover\:text-primary:hover {
    color: inherit;
  }
  
  .hover\:bg-gray-200:hover {
    background-color: inherit;
  }
  
  /* 优化焦点状态 */
  a:focus, button:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
  }
}

/* 横屏手机优化 */
@media (max-height: 500px) and (orientation: landscape) {
  .banner {
    padding-top: 80px !important;
    padding-bottom: 40px !important;
  }
  
  .banner h1 {
    font-size: 24px !important;
    margin-bottom: 0.5rem;
  }
  
  .banner p {
    font-size: 14px !important;
    margin-bottom: 1rem;
  }
  
  .banner .btn {
    margin-top: 1rem;
  }
  
  .ud-header {
    padding: 0.25rem 0;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .banner .slogo img,
  .navbar-logo img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* 暗色模式移动端优化 */
@media (max-width: 768px) {
  .dark .banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  }
  
  .dark #navbarCollapse {
    background-color: #1f2937 !important;
    border-color: rgba(75, 85, 99, 0.3);
  }
  
  .dark #navbarCollapse ul li a {
    border-bottom-color: rgba(75, 85, 99, 0.2);
  }
}

/* 可访问性优化 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印样式优化 */
@media print {
  .ud-header,
  .banner .btn,
  #theme-toggle,
  #navbarToggler {
    display: none !important;
  }
  
  .banner {
    background: white !important;
    color: black !important;
    padding: 1rem !important;
  }
  
  .banner h1,
  .banner p {
    color: black !important;
  }
}

/* 性能优化 */
.banner .bg,
.banner .slogo img {
  will-change: transform;
}

/* 滚动优化 */
@media (max-width: 768px) {
  body {
    -webkit-overflow-scrolling: touch;
  }
  
  .navbar {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
  }
}

/* 输入框移动端优化 */
@media (max-width: 768px) {
  input, textarea, select {
    font-size: 16px !important; /* 防止iOS缩放 */
    padding: 0.75rem;
    border-radius: 0.375rem;
  }
}

/* 加载动画移动端优化 */
@media (max-width: 768px) {
  .preloader {
    padding: 1rem;
  }
  
  .preloader .inline-block {
    width: 2rem;
    height: 2rem;
  }
  
  .preloader p {
    font-size: 1rem;
    margin-top: 1rem;
  }
}