html { font-size: var(--fs-body); }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 1rem;
}

/* 容器 - 匹配 React max-w-7xl px-4 sm:px-6 lg:px-8 */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container { padding: 0 24px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 32px; }
}

/* ===== 页面入场动画 - 复刻原 React framer-motion ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUpSmall {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeDownSmall {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 加载即播（对应 framer animate={{...}}） */
.anim-hero  { opacity: 0; animation: fadeInUp .8s ease .2s forwards; }      /* HeroSection 0.8s delay .2 */
.anim-hint  { opacity: 0; animation: fadeDownSmall .6s ease 1s forwards; }  /* 滚动指示器 0.6s delay 1 */
.anim-left  { opacity: 0; animation: fadeInLeft .6s ease forwards; }        /* 左栏滑入 0.6s */
.anim-right { opacity: 0; animation: fadeInRight .6s ease forwards; }       /* 右栏滑入 0.6s */
.anim-grid  { animation: fadeInUpSmall .4s ease both; }                     /* 产品网格 0.4s（筛选切换重播） */
.anim-card  { opacity: 0; animation: fadeInUpSmall .4s ease forwards; }     /* 产品卡片 0.4s + 逐个延迟 */
.anim-scale { opacity: 0; animation: fadeInScale .3s ease forwards; }       /* 案例卡片 0.3s（筛选切换重播） */

/* 滚动进入视口播放（对应 whileInView={{ once: true, amount: 0.3 }}） */
.anim-view { opacity: 0; }
.anim-view-up.in-view    { animation: fadeInUp .6s ease forwards; }
.anim-view-left.in-view  { animation: fadeInLeft .6s ease forwards; }
.anim-view-right.in-view { animation: fadeInRight .6s ease forwards; }
.anim-view-scale.in-view { animation: fadeInScale .4s ease forwards; }

/* 语言切换重渲染时跳过动画（React 切换语言不重放入场动画） */
.no-anim, .no-anim * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* 标题 */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { color: var(--color-text); }

a {
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; display: block; }

/* Section 通用 */
.section {
  padding: var(--space-section) 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section-title {
  text-align: center;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-light);
  font-size: var(--fs-h4);
  margin-bottom: 48px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-accent {
  background: var(--color-accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--color-accent-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-lg { padding: 16px 36px; font-size: var(--fs-h4); }

/* 通用卡片 */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

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

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: var(--fs-small);
  color: var(--color-text-light);
  padding: 20px 0;
}

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

.breadcrumb li::after {
  content: "/";
  margin-left: 8px;
  color: var(--color-text-lighter);
}

.breadcrumb li:last-child::after { content: ""; }

.breadcrumb li:last-child { color: var(--color-primary); font-weight: 600; }

/* 工具类 */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-light { color: var(--color-text-light); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* 可访问性 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
