/* ===== CSS变量 ===== */
:root {
  --primary-color: #7c3aed;
  --primary-dark: #6d28d9;
  --secondary-color: #0f0a1e;
  --text-color: #334155;
  --text-light: #64748b;
  --bg-light: #f5f3ff;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --transition: all 0.3s ease;
}

/* ===== 统计数据 ===== */
.stats-section {
  background: linear-gradient(135deg,#0f0a1e,#4c1d95);
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.stat-item {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 20px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  gap: 8px;
}

.stat-item::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: linear-gradient(145deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
  border-radius: 14px;
  z-index: 0;
}

.stat-item:hover {
  transform: translateY(-5px);
  background: linear-gradient(145deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 15px 35px rgba(0,0,0,0.25);
}

.stat-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(124,58,237,0.35);
  position: relative;
  z-index: 1;
  transition: all 0.35s ease;
}

.stat-icon i {
  position: relative;
  z-index: 2;
}

.stat-item:hover .stat-icon {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 8px 25px rgba(124,58,237,0.5);
}

.stat-number {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  position: relative;
}

.stat-number .num {
  font-size: 46px;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #ede9fe 50%, #fff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-number .suffix {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  position: relative;
  top: -2px;
}

.stat-label {
  display: inline-block;
  font-size: 13px;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 200;
  background: linear-gradient(135deg, rgba(124,58,237,0.7), rgba(167,139,250,0.8));
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid rgba(167,139,250,0.5);
  vertical-align: top;
  margin-left: 4px;
}

.stat-content {
  display: flex;
  align-items: center;
}

/* ===== 关于我们（模板版） ===== */
.about-section .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-content h2 {
  font-size: 36px;
  background: linear-gradient(90deg, #1a1a1a 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  position: relative;
  display: inline-block;
}

.about-content h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
}

.about-content p {
  color: var(--text-light);
  line-height: 1.8;
 
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 35px;
}

.about-feature {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: linear-gradient(145deg, #ffffff, #f5f3ff);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.about-feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.about-feature i {
  color: var(--white);
  font-size: 24px;
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, var(--primary-color), #6d28d9);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.about-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.about-img {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  line-height: 0;
  transition: transform 0.4s ease;
}

.about-img:first-child {
  margin-top: 50px;
}

.about-img:hover {
  transform: scale(1.02);
}

.about-img img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* ===== 服务特色 ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.service-card {
  background: linear-gradient(145deg, #ffffff 0%, #f5f3ff 100%);
  border-radius: 24px;
  padding: 45px 30px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(124,58,237,0.08);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #a78bfa, var(--primary-color));
  background-size: 200% 100%;
  transform: scaleX(0);
  transition: transform 0.5s ease;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(124,58,237,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.service-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0,0,0,0.12), 0 10px 20px rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.2);
}

.service-card:hover::before {
  transform: scaleX(1);
  background-position: 100% 0;
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #6d28d9 50%, var(--primary-color) 100%);
  background-size: 200% 200%;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 30px;
  color: var(--white);
  font-size: 36px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(124,58,237,0.3);
  position: relative;
  z-index: 1;
}

.service-card:hover .service-icon {
  transform: scale(1.15) rotate(5deg);
  box-shadow: 0 15px 40px rgba(124,58,237,0.4);
  background-position: 100% 0;
}

.service-card h3 {
  font-size: 22px;
  color: var(--secondary-color);
  margin-bottom: 15px;
}

.service-card p {
  color: var(--text-light);
  line-height: 1.8;
}

/* ===== 产品展示：固定4列网格 ===== */
body .products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

/* ===== 横向滚动容器 ===== */
.scroll-container {
  position: relative;
}

.scroll-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 20px;
}

.scroll-wrapper::-webkit-scrollbar {
  display: none;
}

.scroll-content {
  display: flex;
  gap: 30px;
  padding: 10px 5px;
}

.scroll-content > * {
  flex: 0 0 320px;
  min-width: 320px;
}

/* 滚动箭头按钮 */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: var(--white);
  border: none;
  border-radius: 50%;
  color: var(--secondary-color);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-arrow:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

.scroll-arrow.prev {
  left: -25px;
}

.scroll-arrow.next {
  right: -25px;
}

.scroll-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.scroll-arrow:disabled:hover {
  background-color: var(--white);
  color: var(--secondary-color);
}

/* 拖拽滚动样式 */
.scroll-wrapper {
  cursor: grab;
}

.scroll-wrapper.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.scroll-wrapper.dragging * {
  pointer-events: none;
}

.scroll-wrapper a,
.scroll-wrapper a * {
  pointer-events: auto !important;
}

/* ===== 案例横向滚动 ===== */
.cases-scroll-content {
  flex-wrap: nowrap;
}

.cases-scroll-content > * {
  flex: 0 0 calc((100% - 60px) / 3);
  min-width: calc((100% - 60px) / 3);
}

/* ===== 案例卡片（模板版，body 前缀覆盖） ===== */
body .case-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 320px;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}

body .case-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

body .case-card:hover img {
  transform: scale(1.08);
}

body .case-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9), transparent);
  color: var(--white);
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
}

body .case-card:hover .case-overlay {
  transform: translateY(0);
  opacity: 1;
}

body .case-tag {
  display: inline-block;
  padding: 5px 15px;
  background-color: var(--primary-color);
  border-radius: 20px;
  font-size: 12px;
  margin-bottom: 10px;
}

body .case-overlay h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

body .case-overlay p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

/* ===== 动画 ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
  body .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .scroll-arrow {
    display: none;
  }
  .scroll-wrapper {
    overflow: visible;
  }
  .scroll-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .scroll-content > * {
    flex: none;
    min-width: auto;
  }
  .cases-section .scroll-wrapper {
    overflow: visible;
    cursor: default;
  }
  .cases-scroll-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    flex-wrap: wrap;
  }
  .cases-scroll-content > * {
    flex: none;
    min-width: auto;
    width: auto;
  }
  body .case-card {
    height: 180px;
  }
  body .case-overlay {
    padding: 15px;
  }
  body .case-overlay h3 {
    font-size: 14px;
    margin-bottom: 5px;
  }
  body .case-overlay p {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body .case-tag {
    font-size: 10px;
    padding: 3px 10px;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .service-card {
    padding: 25px 15px;
  }
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 24px;
    margin-bottom: 15px;
  }
  .service-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  .service-card p {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  body .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .about-section .container {
    grid-template-columns: 1fr;
  }
  .stat-number {
    font-size: 36px;
  }
  .case-overlay.mobile-show {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

.stats-section { display: none; }

.about-feature {
  flex-direction: column;
  text-align: center;
  gap: 10px;
}
}

@media (max-width: 480px) {
  .stats-grid {
    gap: 15px;
  }
  .stat-item {
    flex-direction: column;
    gap: 8px;
    padding: 15px 10px;
  }
  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
    border-radius: 8px;
  }
  .stat-number .num {
    font-size: 26px;
  }
}

/* ===== 手机端幻灯：调用 slide:ico，比例 750×375（2:1） ===== */
.slide-bg-mob { display: none; }

@media (max-width: 768px) {
  .hero-slider {
    height: 50vw !important;
    max-height: 375px;
  }
  .slide-bg-desk { display: none; }
  .slide-bg-mob {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}
