/**
 * 鲁格科技官网样式表
 * 教育AI解决方案专家
 * 优化版本 - 包含CSS变量系统和性能优化
 */

/* ========================================
   CSS变量系统 - 设计系统
   ======================================== */
:root {
  /* 颜色系统 */
  --color-primary: #1a1a1a;
  --color-primary-hover: #333;
  --color-text-primary: #2c2c2c;
  --color-text-secondary: #4a4a4a;
  --color-text-muted: #666;
  --color-text-light: #999;
  --color-bg-primary: #fbfbfb;
  --color-bg-secondary: #f8f8f8;
  --color-bg-white: #ffffff;
  --color-border: #f0f0f0;
  --color-border-light: #e0e0e0;
  --color-border-hover: #d0d0d0;
  --color-accent: #4caf50;
  --color-overlay: rgba(251, 251, 251, 0.6);
  --color-overlay-white: rgba(255, 255, 255, 0.5);

  /* 间距系统 */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  --spacing-3xl: 5rem;

  /* 字体系统 */
  --font-family-primary: "ZCOOL CangEr YuYang W03", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-display: "ZCOOL CangEr YuYang W05", sans-serif;
  --font-size-xs: 0.875rem;
  --font-size-sm: 0.9rem;
  --font-size-base: 1rem;
  --font-size-md: 1.125rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2.5rem;
  --font-size-3xl: 3rem;
  --font-size-hero: 10rem;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* 圆角系统 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* 阴影系统 */
  --shadow-sm: 0 1px 10px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.08);

  /* 过渡系统 */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.6s ease;
  --transition-smooth: 0.8s ease-out;
  --transition-hero: 1.5s cubic-bezier(0.65, 0, 0.35, 1);
  --transition-hero-fast: 1.2s cubic-bezier(0.65, 0, 0.35, 1);
  --transition-hero-slow: 0.8s cubic-bezier(0.65, 0, 0.35, 1);

  /* 布局系统 */
  --container-max-width: 1200px;
  --container-padding: 2rem;
  --navbar-height: 80px;

  /* Z-index系统 */
  --z-index-navbar: 1000;
  --z-index-modal: 2000;
  --z-index-tooltip: 3000;
}

/* 移动端变量调整 */
@media (max-width: 576px) {
  :root {
    --container-padding: 1rem;
    --spacing-3xl: 3rem;
    --font-size-hero: 2.5rem;
  }
}

/* ========================================
   字体定义
   ======================================== */
@font-face {
  font-family: "ZCOOL CangEr YuYang W05";
  src: url("../fonts/站酷仓耳渔阳体-W05.ttf") format("truetype");
  font-display: swap; /* 优化字体加载 */
}

@font-face {
  font-family: "ZCOOL CangEr YuYang W03";
  src: url("../fonts/站酷仓耳渔阳体-W03.ttf") format("truetype");
  font-display: swap; /* 优化字体加载 */
}

/* ========================================
   全局样式重置
   ======================================== */
html {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-primary);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

/* 标题字体 */
.hero h1,
.section-title {
  font-family: var(--font-family-display);
}

/* ========================================
   导航栏
   ======================================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(251, 251, 251, 0.95);
  z-index: var(--z-index-navbar);
  padding: var(--spacing-sm) 0;
  transition: all var(--transition-base);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* 浏览器兼容性 - backdrop-filter降级方案 */
@supports (backdrop-filter: blur(20px)) {
  .navbar {
    backdrop-filter: blur(20px);
  }
}

@supports not (backdrop-filter: blur(20px)) {
  .navbar {
    background: rgba(251, 251, 251, 0.98);
  }
}

.nav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--container-padding);
}

.logo {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-normal);
  transition: color var(--transition-base);
  position: relative;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-links a:hover::after {
  width: 100%;
}

.cta-button {
  background: var(--color-primary);
  color: var(--color-bg-white);
  padding: 0.75rem var(--spacing-md);
  border: none;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  font-weight: var(--font-weight-normal);
}

.cta-button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* ========================================
   Hero区域
   ======================================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-image: linear-gradient(var(--color-overlay), var(--color-overlay)),
    url("../images/jess-bailey-l3N9Q27zULw-unsplash.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
  padding-top: var(--navbar-height);
  overflow: hidden;
  content-visibility: auto; /* 性能优化 */
}

.hero-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--container-padding);
}

.hero-content {
  text-align: center;
  width: 100%;
  transform: translate3d(0, 0, 0); /* GPU加速 */
  transition: transform var(--transition-hero), width var(--transition-hero);
}

.hero-container.active .hero-content {
  width: 30%;
  transform: translate3d(-65%, 0, 0);
}

.hero-container.active .hero-content h1 {
  font-size: clamp(2.5rem, 8vw, 4rem); /* 流体排版 */
}

/* 轮播图容器 */
.carousel {
  position: relative;
  width: 0;
  aspect-ratio: 16 / 9;
  background: var(--color-overlay-white);
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: width var(--transition-hero-fast) 0.3s, opacity var(--transition-hero-slow) 0.5s;
  flex-shrink: 0;
  overflow: hidden;
}

.hero-container.active .carousel {
  width: 100%;
  opacity: 1;
  margin-left: auto;
  margin-right: -300px;
}

/* 轮播图幻灯片容器 */
.carousel-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--transition-slow);
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 左右切换按钮 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  padding: 0;
}

.carousel-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--color-primary);
  border-right: 2px solid var(--color-primary);
  transition: border-color var(--transition-base);
}

.carousel:hover .carousel-btn {
  opacity: 1;
  pointer-events: auto;
}

.carousel-btn:hover {
  background: var(--color-primary);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-btn:hover::before {
  border-color: white;
}

.carousel-btn-prev {
  left: 20px;
}

.carousel-btn-prev::before {
  transform: translate(-30%, -50%) rotate(-135deg);
}

.carousel-btn-next {
  right: 20px;
}

.carousel-btn-next::before {
  transform: translate(-70%, -50%) rotate(45deg);
}

/* 指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.2);
}

.indicator.active {
  background: white;
  border-color: var(--color-primary);
  transform: scale(1.3);
}

.hero h1 {
  font-size: clamp(2.5rem, 10vw, var(--font-size-hero)); /* 流体排版 */
  margin-bottom: var(--spacing-md);
  font-weight: var(--font-weight-light);
  line-height: 1.1;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  transition: font-size var(--transition-hero);
}

.hero p {
  font-size: var(--font-size-md);
  margin-bottom: var(--spacing-xl);
  color: var(--color-text-muted);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  transition: all var(--transition-hero);
  min-height: calc(var(--font-size-md) * 1.6 * 5);
}

.hero-buttons {
  display: flex;
  gap: var(--spacing-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* ========================================
   按钮样式
   ======================================== */
.btn-primary,
.btn-secondary {
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-normal);
  text-decoration: none;
  transition: all var(--transition-base);
  display: inline-block;
  font-size: var(--font-size-base);
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-bg-white);
  border: none;
}

.btn-secondary {
  background: var(--color-bg-primary);
  color: var(--color-primary);
  border: 1px solid var(--color-border-light);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: var(--color-border-hover);
}

/* ========================================
   通用容器和网格
   ======================================== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section-title {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, var(--font-size-2xl)); /* 流体排版 */
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-light);
}

.section-subtitle {
  text-align: center;
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   产品展示区域
   ======================================== */
.products-section {
  padding: var(--spacing-3xl) 0;
  background: var(--color-bg-white);
  content-visibility: auto; /* 性能优化 */
}

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

.product-card {
  background: var(--color-bg-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  contain: layout style paint; /* 性能优化 */
}

.product-card:hover {
  transform: translate3d(0, -4px, 0); /* GPU加速 */
  box-shadow: var(--shadow-lg);
}

.product-header {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-sm);
  text-align: center;
}

.product-icon {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-sm);
  display: flex;
  justify-content: center;
  align-items: center;
}

.product-icon-img {
  height: 80px;
  object-fit: contain;
}

.product-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

.product-tagline {
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
  margin-bottom: var(--spacing-md);
}

.product-content {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.product-description {
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
}

.product-features {
  list-style: none;
  margin-bottom: var(--spacing-lg);
}

.product-features li {
  padding: var(--spacing-xs) 0;
  color: var(--color-text-muted);
  position: relative;
  padding-left: var(--spacing-md);
}

.product-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
}

.product-cta {
  text-align: center;
}

/* ========================================
   应用场景
   ======================================== */
.use-cases {
  padding: var(--spacing-3xl) 0;
  background: var(--color-bg-secondary);
  content-visibility: auto;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.case-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  text-align: center;
  transition: all var(--transition-base);
  contain: layout style paint;
}

.case-card:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-md);
}

.case-icon {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-sm);
}

.case-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
}

.case-description {
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ========================================
   统计数据
   ======================================== */
.stats {
  padding: var(--spacing-2xl) 0;
  background: var(--color-bg-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-xl);
  text-align: center;
}

.stat-item h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-xs);
  color: var(--color-primary);
  font-weight: var(--font-weight-light);
}

.stat-item p {
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

/* ========================================
   用户证言
   ======================================== */
.testimonials {
  padding: var(--spacing-3xl) 0;
  background: var(--color-bg-white);
  content-visibility: auto;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.testimonial-card {
  background: var(--color-bg-primary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
  contain: layout style paint;
}

.testimonial-card:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--shadow-md);
}

.testimonial-text {
  font-style: italic;
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.testimonial-author {
  font-weight: var(--font-weight-medium);
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.testimonial-title {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
}

/* ========================================
   CTA区域
   ======================================== */
.cta-section {
  padding: var(--spacing-3xl) 0;
  background: var(--color-primary);
  color: var(--color-bg-white);
  text-align: center;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, var(--font-size-2xl));
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-light);
}

.cta-section p {
  font-size: var(--font-size-md);
  margin-bottom: var(--spacing-lg);
  opacity: 0.8;
}

.cta-section .btn-primary {
  background: var(--color-bg-white);
  color: var(--color-primary);
}

.cta-section .btn-primary:hover {
  background: #f5f5f5;
}

.cta-section .btn-secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--color-bg-white);
}

.cta-section .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   页脚
   ======================================== */
.footer {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
  padding: var(--spacing-sm) 0 var(--spacing-sm);
  border-top: 1px solid var(--color-border);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
  margin-bottom: var(--spacing-sm);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
}

.footer-section a {
  color: var(--color-text-muted);
  text-decoration: none;
  display: block;
  margin-bottom: var(--spacing-xs);
  transition: color var(--transition-base);
  font-size: var(--font-size-sm);
}

.footer-section a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  text-align: center;
  color: var(--color-text-light);
  font-size: var(--font-size-xs);
  a{
    margin-left: var(--spacing-xs);
    color: var(--color-text-light);
    text-decoration: none;
    font-size: var(--font-size-xs);
    transition: color var(--transition-base);
    &:hover {
      color: var(--color-primary);
    }
  }
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 576px) {
  .nav-links {
    display: none;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .products-grid,
  .cases-grid,
  .testimonial-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 577px) and (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 769px) and (max-width: 991px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* ========================================
   动画效果
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 20px, 0); /* GPU加速 */
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.fade-in-up {
  animation: fadeInUp var(--transition-smooth);
}
