/*
  SEO & Performance Optimization Styles
  优化加载策略、视觉层次、结构化标记
*/

/* ============================================
   1. Core Web Vitals 优化
   ============================================ */

/* 减少 CLS (Cumulative Layout Shift) */
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 预留图片空间，防止布局跳动 */
.product-card img,
.news-item img,
.category-card img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background-color: #f8fafc;
}

/* ============================================
   2. 视觉层次增强
   ============================================ */

/* 主内容区域 - 改善可读性 */
.site-main {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* 标题层次清晰 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: #1a202c;
  margin-top: 2em;
  margin-bottom: 1em;
}

h1 { font-size: clamp(28px, 5vw, 42px); }
h2 { font-size: clamp(24px, 4vw, 32px); }
h3 { font-size: clamp(20px, 3vw, 26px); }

/* 段落可读性 */
p {
  line-height: 1.7;
  margin-bottom: 1.2em;
  max-width: 75ch; /* 最佳阅读宽度 */
}

/* ============================================
   3. CTA (Call to Action) 优化
   ============================================ */

/* 主要按钮 */
.btn-primary,
.hero-btn,
input[type="submit"] {
  background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
  color: #ffffff;
  padding: 14px 32px;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 74, 153, 0.3);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover,
.hero-btn:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 74, 153, 0.4);
  background: linear-gradient(135deg, #0055a5 0%, #0077ee 100%);
}

/* 次要按钮 */
.btn-secondary {
  background: transparent;
  color: #004a99;
  border: 2px solid #004a99;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-secondary:hover {
  background: #004a99;
  color: #ffffff;
}

/* ============================================
   4. 产品展示优化
   ============================================ */

/* 产品卡片 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 40px 0;
}

.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.product-card-content {
  padding: 20px;
}

.product-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1a202c;
}

.product-card-meta {
  font-size: 14px;
  color: #718096;
  margin-bottom: 12px;
}

.product-card-link {
  display: inline-block;
  color: #004a99;
  font-weight: 500;
  text-decoration: none;
}

.product-card-link:hover {
  color: #0066cc;
  text-decoration: underline;
}

/* ============================================
   5. 信任元素增强
   ============================================ */

/* 认证标志 */
.certifications {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 40px 0;
  margin: 40px 0;
  background: #f8fafc;
  border-radius: 12px;
}

.cert-item {
  text-align: center;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.cert-item:hover {
  opacity: 1;
}

/* 客户评价/案例 */
.testimonials {
  padding: 60px 0;
  background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.testimonial-card {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin: 20px 0;
}

/* ============================================
   6. 页脚 SEO 优化
   ============================================ */

.site-footer {
  background: #1a202c;
  color: #e2e8f0;
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-section h3 {
  color: #ffffff;
  font-size: 18px;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: #00b4d8;
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section a {
  color: #a0aec0;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: #00b4d8;
}

.footer-bottom {
  text-align: center;
  padding-top: 40px;
  margin-top: 40px;
  border-top: 1px solid #2d3748;
  font-size: 14px;
  color: #718096;
}

/* ============================================
   7. 移动端优化
   ============================================ */

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .certifications {
    gap: 20px;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }

  .btn-primary,
  .hero-btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* ============================================
   8. 性能优化
   ============================================ */

/* 减少重绘和回流 */
.product-card,
.news-item,
.category-card {
  will-change: transform;
}

/* 图片懒加载占位 */
img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 焦点可见性（无障碍） */
a:focus,
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #00b4d8;
  outline-offset: 2px;
}

/* ============================================
   9. Schema.org 标记辅助类
   ============================================ */

/* 这些类配合 JavaScript 用于动态注入结构化数据 */
.schema-product { /* 产品标记 */ }
.schema-article { /* 文章标记 */ }
.schema-organization { /* 组织信息 */ }
.schema-breadcrumb { /* 面包屑 */ }
