/* 
 * 首页优化样式文件
 * 根据客户要求实现：字体统一、排版层级、布局留白、响应式适配、交互反馈
 */

/* ==================== 1. 字体与排版系统 ==================== */

/* 引入现代无衬线字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* CSS变量定义 - 统一的设计系统 */
:root {
  /* 字体系统 */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* 字体大小层级 */
  --font-size-h1: clamp(28px, 4vw, 40px);      /* 大标题 */
  --font-size-h2: clamp(22px, 3vw, 28px);      /* 中标题 */
  --font-size-h3: clamp(18px, 2.5vw, 24px);    /* 小标题 */
  --font-size-body: 16px;                       /* 正文 */
  --font-size-small: 14px;                      /* 辅助文字 */
  
  /* 行高系统 */
  --line-height-tight: 1.2;                     /* 标题行高 */
  --line-height-normal: 1.6;                    /* 正文行高 */
  --line-height-loose: 1.8;                     /* 宽松行高 */
  
  /* 间距系统 */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  --spacing-xxl: 64px;
  
  /* 颜色系统 */
  --color-primary: #09a2e6;
  --color-primary-hover: #0891d1;
  --color-text-primary: #333333;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-background: #ffffff;
  --color-background-light: #f8f9fa;
  --color-border: #e5e7eb;
  
  /* 阴影系统 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  
  /* 过渡效果 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

/* 基础重置和全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

/* ==================== 2. 布局与留白系统 ==================== */

/* 容器系统 - 确保最小16px边距 */
.container {
  max-width: 1600px;
  margin: 0 auto;
  /*padding: 0 max(var(--spacing-sm), 2vw); */
  /* 最小16px，响应式增长 */
  width: 100%;
}

/* 区块间距统一 */
.section-spacing {
  padding: clamp(var(--spacing-xl), 8vw, var(--spacing-xxl)) 0;
}

/* 标题系统 */
.section-title-wrapper {
  margin-bottom: var(--spacing-xl);
  text-align: left;
}

.section-title-main {
  font-size: var(--font-size-h2);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-sm);
}

.section-description {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  max-width: 80ch; /* 限制行长度，提高可读性 */
}

/* ==================== 3. 交互反馈系统 ==================== */

/* 通用交互元素 */
.btn-interactive {
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-interactive:hover {
  transform: translateY(-2px);
}

.btn-interactive:active {
  transform: translateY(0);
}

/* 主要按钮样式 */
.btn-primary {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-primary);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: var(--font-size-body);
  border: none;
  min-height: 44px; /* 确保最小可点击区域 */
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
}

/* 链接样式 */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

a:hover {
  /*color: var(--color-primary-hover);*/
  text-decoration: underline;
}

/* ==================== 4. 首页特定样式 ==================== */

/* Hero Section */
.hero {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero-title {
  font-size: var(--font-size-h1);
  font-weight: 700;
  color: white;
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-description {
  font-size: var(--font-size-body);
  color: rgba(255, 255, 255, 0.9);
  line-height: var(--line-height-loose);
  max-width: 60ch;
}

.hero-dots {
  position: absolute;
  bottom: var(--spacing-lg);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--spacing-xs);
}

.hero-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hero-dot.active,
.hero-dot:hover {
  background-color: white;
  transform: scale(1.2);
}

/* 产品卡片系统 */
.interactive-card {
  transition: all var(--transition-normal);
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--color-background);
}

.interactive-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.product-card {
  text-align: center;
  /*padding: var(--spacing-lg);*/
  background-color: var(--color-background);
  border-radius: 12px;
  /*box-shadow: var(--shadow-sm);*/
  transition: all var(--transition-normal);
  overflow: hidden;
  position: relative;
}

/* Full-Chain Solution 产品卡片图片放大效果 */
.full-chain .product-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: var(--spacing-md);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.full-chain .product-card:hover img {
  transform: scale(1.1);
}

/* 通用产品卡片图片放大效果 - 备用选择器 */
.product-card img {
  transition: transform 0.3s ease;
}

.product-card:hover img {
  transform: scale(1.1);
}

/* 鼠标指针样式 */
.product-card {
  cursor: pointer;
}

.product-card a {
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

.product-image-wrapper {
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  border-radius: 8px;
}

.product-image-wrapper img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.interactive-card:hover .product-image-wrapper img {
  transform: scale(1.05);
}

.product-card-title {
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

/* 响应式网格系统 */
.responsive-grid {
  display: grid;
  gap: var(--spacing-lg);
}

/* 产品项目样式 */
.product-item {
  background-color: #f3f4f8;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.product-link {
  display: block;
  padding: var(--spacing-lg);
  text-decoration: none;
  color: inherit;
}

.product-item-title {
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-top: var(--spacing-sm);
  text-align: center;
}

/* 按钮容器 */
.button-wrapper {
  text-align: center;
  margin-top: var(--spacing-xl);
}

/* 表单系统 */
.form-modern {
  background-color: var(--color-background-light);
  padding: var(--spacing-xl);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.form-title {
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  text-align: center;
}

.contact-form-modern .form-group {
  margin-bottom: var(--spacing-md);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-body);
  transition: border-color var(--transition-fast);
  min-height: 44px; /* 确保最小可点击区域 */
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(9, 162, 230, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  margin-top: var(--spacing-sm);
}

/* 统计数据样式 */
.responsive-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.stat-item {
  text-align: center;
  padding: var(--spacing-lg);
}

.stat-number {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--spacing-xs);
}

.stat-text {
  font-size: var(--font-size-body);
  color: #000;
  font-weight: bold;
  font-size: 20px;
}

/* 新闻网格系统 */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xl);
}

.news-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xl);
  align-items: center;
  padding: var(--spacing-lg);
  border-radius: 12px;
  background-color: var(--color-background);
  box-shadow: var(--shadow-sm);
}

.news-item-reverse {
  direction: rtl;
}

.news-item-reverse > * {
  direction: ltr;
}

.news-image-wrapper {
  overflow: hidden;
  border-radius: 8px;
}

.news-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.news-item:hover .news-image {
  transform: scale(1.05);
}

.news-title {
  font-size: var(--font-size-h3);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--spacing-sm);
}

.news-excerpt {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  line-height: var(--line-height-loose);
  margin-bottom: var(--spacing-sm);
}

.news-date {
  font-size: var(--font-size-small);
  color: var(--color-text-light);
  font-weight: 500;
}

/* 项目导航按钮 */
.project-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--color-text-primary);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.project-nav:hover {
  background-color: white;
  transform: translateY(-50%) scale(1.1);
}

.project-nav.prev {
  left: var(--spacing-sm);
}

.project-nav.next {
  right: var(--spacing-sm);
}

/* 视频响应式 */
.responsive-video {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.video-fallback {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
  text-align: center;
  padding: var(--spacing-lg);
}

/* ==================== 5. 响应式适配 ==================== */

/* 平板端适配 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
  
  .responsive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .responsive-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 手机端适配 (< 768px) */
@media (max-width: 767px) {
  /* 确保最小16px边距 */
  .container {
    padding: 0 var(--spacing-sm);
  }
  
  /* 字体大小调整 */
  :root {
    --font-size-body: 14px;
    --font-size-small: 12px;
  }
  
  /* 区块间距调整 */
  .section-spacing {
    padding: var(--spacing-lg) 0;
  }
  
  /* 网格系统单列显示 */
  .responsive-grid,
  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .responsive-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }
  
  /* 新闻项目单列显示 */
  .news-item {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .news-item-reverse {
    direction: ltr;
  }
  
  /* 表单优化 */
  .form-modern {
    padding: var(--spacing-lg);
  }
  
  /* 按钮最小尺寸确保 */
  .btn-primary {
    min-height: 44px;
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  /* Hero区域调整 */
  .hero {
    min-height: 50vh;
  }
  
  .hero-title {
    font-size: clamp(24px, 6vw, 32px);
  }
  
  /* 项目导航按钮位置调整 */
  .project-nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .project-nav.prev {
    left: var(--spacing-xs);
  }
  
  .project-nav.next {
    right: var(--spacing-xs);
  }
}

/* 超小屏幕适配 (< 480px) */
@media (max-width: 479px) {
  .responsive-stats {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: clamp(28px, 8vw, 36px);
  }
}

/* ==================== 6. 可访问性和稳定性 ==================== */

/* 焦点状态 */
*:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  :root {
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-border: #000000;
  }
}

/* 确保文字不会溢出容器 */
.section-description,
.news-excerpt,
.product-item-title,
.news-title {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* 图片响应式和加载优化 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 确保容器不会溢出 */
* {
  /*max-width: 100%;*/
}
