/* 沐光物流 VTC 官网自定义样式 */

/* 自定义样式 */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.truck-gradient {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.neon-glow {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.message-pager {
  overflow: hidden;
}

.message-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.2rem;
  transition: transform .35s ease;
}

.message-card {
  flex: 0 0 calc((100% - 3 * 1.2rem) / 4);
  max-width: calc((100% - 3 * 1.2rem) / 4);
}

@media (max-width: 576px) {
  .message-card {
    flex: 0 0 calc((100% - 3 * 1.2rem) / 4);
    max-width: calc((100% - 3 * 1.2rem) / 4);
  }
}

#galleryContainer {
  min-height: 600px;
  transition: all 0.3s ease;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #1e293b;
}

::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* 图片懒加载样式 */
img.lazy-loading {
  opacity: 0.7;
  filter: blur(2px);
  background: #1e293b;
  background-size: cover;
  background-position: center;
}

img.lazy-loaded {
  opacity: 1;
  filter: none;
}

img.lazy-error {
  opacity: 0.5;
  filter: grayscale(100%);
  background: #1e293b;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.image-container.lazy-loading {
  position: relative;
  overflow: hidden;
}

.image-container.lazy-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 25%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

.image-container.lazy-loaded::before {
  display: none;
}

.gallery-preview.lazy-loading {
  position: relative;
  overflow: hidden;
}

.gallery-preview.lazy-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 25%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

.route-image-preview.lazy-loading {
  position: relative;
  overflow: hidden;
}

.route-image-preview.lazy-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      transparent 25%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 1;
}

/* 卡车向右行驶效果样式 */
.truck-scroll-effect {
  will-change: transform, opacity;
  transform-origin: center center;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

/* 优化滚动性能 */
.truck-scroll-effect * {
  backface-visibility: hidden;
  perspective: 1000px;
}

/* 移动端宽度优化 */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* 确保所有容器不会超出屏幕宽度 */
* {
  box-sizing: border-box;
}

/* Hero title 高度优化 - 确保数学斜体字符完全显示 */
#hero h1 {
  line-height: 1.3 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  overflow: visible !important;
  display: block;
}

@media (min-width: 640px) {
  #hero h1 {
    line-height: 1.25 !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
}

@media (min-width: 1024px) {
  #hero h1 {
    line-height: 1.2 !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }
}

/* 移动端文字大小优化 */
@media (max-width: 640px) {
  .text-4xl {
    font-size: 2rem;
  }
  
  .text-5xl {
    font-size: 2.5rem;
  }
  
  /* 确保长文本不会溢出 */
  .text-nowrap {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
}

/* 移动端导航优化 */
@media (max-width: 1023px) {
  .navbar-nav-link,
  .navbar-dropdown-button {
    white-space: normal;
    word-wrap: break-word;
  }
}

/* 移动端留言板优化 */
@media (max-width: 640px) {
  /* 留言卡片移动端优化 */
  .message-card {
    margin-bottom: 1rem;
  }
  
  /* 留言表单移动端优化 */
  #messageForm {
    padding: 0.5rem;
  }
  
  /* 验证码容器移动端优化 */
  #captchaContainer {
    margin: 0 auto;
    transform: scale(0.9);
  }
  
  /* 分页按钮移动端优化 */
  .pagination {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .pagination li {
    margin: 0.125rem;
  }
  
  /* 留言内容文字大小优化 */
  .message-content {
    font-size: 0.875rem;
    line-height: 1.5;
  }
  
  /* 留言卡片内边距优化 */
  .message-card-inner {
    padding: 0.75rem;
  }
}

/* 中等屏幕优化 */
@media (min-width: 641px) and (max-width: 768px) {
  /* 留言卡片中等屏幕优化 */
  .message-card {
    margin-bottom: 1.25rem;
  }
  
  /* 验证码容器中等屏幕优化 */
  #captchaContainer {
    transform: scale(0.95);
  }
}

/* 大屏幕优化 */
@media (min-width: 1024px) {
  /* 留言卡片大屏幕优化 */
  .message-card {
    margin-bottom: 1.5rem;
  }
  
  /* 验证码容器大屏幕优化 */
  #captchaContainer {
    transform: scale(1);
  }
}

/* 留言板响应式网格优化 */
@media (max-width: 640px) {
  #messagesContainer {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  #messagesContainer {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #messagesContainer {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 1025px) {
  #messagesContainer {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}