/* ============================================
   企业通用网站模板 — 主样式表
   版本: 1.2
   说明: 修改 :root 中的变量即可全局换肤
   ============================================ */

/* ---------- CSS 变量（一键换肤） ---------- */
:root {
  --color-primary: #2563eb;
  --color-primary-rgb: 37, 99, 235;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #3b82f6;
  --color-accent: #f59e0b;
  --color-accent-bg: #eff6ff;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-white: #ffffff;
  --color-border: #e2e8f0;
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --max-width: 1200px;
  --nav-height: clamp(60px, 9vw, 72px);
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
  /* 缓动曲线：统一过渡手感 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 0.3s var(--ease);
  /* 流式排版：随视口平滑缩放，替代多档断点跳变 */
  --gutter: clamp(16px, 4vw, 24px);
  --space-section: clamp(56px, 9vw, 100px);
  --fs-hero: clamp(28px, 5.4vw, 48px);
  --fs-h2: clamp(22px, 3.2vw, 36px);
  --fs-h1-page: clamp(28px, 4.8vw, 40px);
  --fs-lead: clamp(15px, 1.9vw, 20px);
  --fs-sub: clamp(14px, 1.7vw, 18px);
}

/* ---------- 全局重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: break-word;
}

/* 移动端菜单展开时锁定背景滚动 */
body.menu-open {
  overflow: hidden;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul {
  list-style: none;
}

/* 键盘操作焦点环（鼠标点击不显示） */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 通用组件基类 ---------- */

/* 共用卡片样式 */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 卡片悬浮上移 */
.card-lift {
  transition: transform var(--transition), box-shadow var(--transition);
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* 圆形图标容器 */
.circle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* 三列网格（响应式覆写） */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

/* Hero 共用背景 */
.hero-bg {
  text-align: center;
  background: linear-gradient(135deg, var(--color-accent-bg) 0%, #dbeafe 100%);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
    transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

.btn-block {
  width: 100%;
}

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

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

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

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

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

.btn-white:hover {
  background: var(--color-bg-alt);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition),
    background-color var(--transition);
}

/* 支持时启用毛玻璃，滚动时更顺滑（不支持则保持纯色） */
@supports (backdrop-filter: blur(10px)) {
  .navbar {
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(10px) saturate(1.6);
    backdrop-filter: blur(10px) saturate(1.6);
  }
}

.navbar.scrolled {
  box-shadow: var(--shadow);
  border-bottom-color: var(--color-border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-logo span {
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 36px);
}

.nav-menu a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 15px;
  position: relative;
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--color-primary);
}

/* 汉堡菜单按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin: -10px;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

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

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

.section-header {
  text-align: center;
  margin-bottom: clamp(36px, 5.5vw, 60px);
}

.section-header h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.section-header p {
  font-size: var(--fs-sub);
  color: var(--color-text-light);
}

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--nav-height) + clamp(48px, 8vw, 92px)) 0
    var(--space-section);
  /* 继承 .hero-bg */
  text-align: center;
  background: linear-gradient(135deg, var(--color-accent-bg) 0%, #dbeafe 50%, #bfdbfe 100%);
}

.hero h1 {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.hero h1 span {
  color: var(--color-primary);
}

.hero p {
  font-size: var(--fs-lead);
  color: var(--color-text-light);
  max-width: 600px;
  margin: 0 auto clamp(24px, 4vw, 36px);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 服务卡片 ---------- */
.services-grid {
  gap: clamp(20px, 2.8vw, 32px);
}

.service-card {
  padding: clamp(28px, 3.4vw, 40px) clamp(20px, 2.8vw, 32px);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

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

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(58px, 6vw, 72px);
  height: clamp(58px, 6vw, 72px);
  border-radius: 50%;
  background: var(--color-accent-bg);
  margin-bottom: clamp(16px, 2.4vw, 24px);
  font-size: clamp(26px, 3vw, 32px);
}

.service-card h3 {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--color-text-light);
  font-size: 15px;
}

/* ---------- 案例展示 ---------- */
.cases-grid {
  gap: clamp(16px, 2.2vw, 24px);
}

.case-card {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

/* 卡片作为链接时保持原样式（旗下网站跳转卡片） */
a.case-card {
  display: block;
  color: inherit;
}

a.case-card:hover {
  color: inherit;
}

.case-card img {
  width: 100%;
  height: clamp(180px, 21vw, 260px);
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.case-card:hover img {
  transform: scale(1.08);
}

.case-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.1) 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(16px, 2vw, 24px);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition), transform 0.45s var(--ease-out);
}

.case-card:hover .case-overlay,
.case-card:focus-visible .case-overlay {
  opacity: 1;
  transform: translateY(0);
}

.case-overlay h4 {
  font-size: 18px;
  margin-bottom: 4px;
}

.case-overlay span {
  font-size: 13px;
  opacity: 0.85;
}

/* 图片加载失败回退 */
.img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

/* ---------- 评价 ---------- */
.testimonials {
  gap: clamp(20px, 2.8vw, 32px);
}

.testimonial-card {
  padding: clamp(24px, 3vw, 36px) clamp(20px, 2.6vw, 28px);
}

.testimonial-card > p {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: 20px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-author .avatar {
  width: 44px;
  height: 44px;
  background: var(--color-primary-light);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.testimonial-author strong {
  display: block;
  font-size: 15px;
}

.testimonial-author span {
  font-size: 13px;
  color: var(--color-text-light);
}

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  text-align: center;
  padding: clamp(48px, 7vw, 80px) 0;
}

.cta h2 {
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.cta p {
  font-size: var(--fs-sub);
  opacity: 0.9;
  margin-bottom: clamp(22px, 3.5vw, 32px);
}

/* ---------- 页脚 ---------- */
.footer {
  background: var(--color-bg-dark);
  color: #94a3b8;
  padding: clamp(40px, 6vw, 60px) 0 clamp(24px, 3vw, 30px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(24px, 3.5vw, 40px);
  margin-bottom: clamp(28px, 4vw, 40px);
}

.footer h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 16px;
}

.footer-brand h3 span {
  color: var(--color-primary);
}

.footer-brand h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-logo-img {
  height: 30px;
  width: auto;
  display: block;
}

.footer a {
  color: #94a3b8;
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
}

.footer a:hover {
  color: #fff;
}

.footer-brand p {
  font-size: 14px;
  margin-top: 12px;
  max-width: 280px;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: #94a3b8;
}

.footer-bottom .copyright {
  margin-bottom: 6px;
}

/* 备案信息：同行居中，窄屏自动换行 */
.footer-bottom .beian {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.footer-bottom a {
  display: inline-flex;
  align-items: center;
  margin: 0;
  font-size: 13px;
  color: #94a3b8;
}

.footer-bottom a:hover {
  color: #fff;
}

.footer-bottom .beian-sep {
  color: #334155;
  user-select: none;
}

.footer-bottom .beian img {
  display: inline-block;
  height: 15px;
  width: auto;
  margin: 0 5px 0 0;
}

/* ---------- 页面标题栏 ---------- */
.page-hero {
  padding: calc(var(--nav-height) + clamp(44px, 7vw, 90px)) 0
    clamp(40px, 6vw, 60px);
  /* 继承 .hero-bg */
  text-align: center;
  background: linear-gradient(135deg, var(--color-accent-bg) 0%, #dbeafe 100%);
}

.page-hero h1 {
  font-size: var(--fs-h1-page);
  font-weight: 900;
  line-height: 1.25;
}

.page-hero p {
  font-size: var(--fs-sub);
  color: var(--color-text-light);
  margin-top: 8px;
}

/* ---------- 关于页 ---------- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
}

.about-text h2 {
  font-size: clamp(22px, 2.9vw, 32px);
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.35;
}

.about-text p {
  color: var(--color-text-light);
  margin-bottom: 16px;
  line-height: 1.9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 24px);
  margin-top: clamp(24px, 3.4vw, 36px);
}

.stat-item {
  text-align: center;
  padding: clamp(16px, 2.4vw, 24px);
}

.stat-item strong {
  display: block;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1.2;
}

.stat-item span {
  font-size: 14px;
  color: var(--color-text-light);
}

.about-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* 团队 */
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}

.team-card {
  text-align: center;
  padding: clamp(22px, 2.8vw, 32px) clamp(14px, 2vw, 20px);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.team-avatar {
  width: clamp(76px, 8vw, 100px);
  height: clamp(76px, 8vw, 100px);
  margin: 0 auto 16px;
  background: #e2e8f0;
  font-size: clamp(30px, 3.4vw, 40px);
}

.team-card h4 {
  font-size: 17px;
  margin-bottom: 4px;
}

.team-card > span {
  font-size: 14px;
  color: var(--color-text-light);
}

.team-bio {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 8px;
}

/* 时间线 */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: clamp(28px, 5vw, 40px);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 36px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline-item h4 {
  font-size: 18px;
  margin-bottom: 4px;
}

.timeline-item .year {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 700;
}

.timeline-item p {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ---------- 产品页 ---------- */
.product-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 24px;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition),
    border-color var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.products-grid {
  gap: clamp(16px, 2.4vw, 28px);
}

.product-card {
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition),
    opacity 0.28s var(--ease);
}

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

/* 筛选隐藏状态（由 JS 切换：先淡出，动画结束后移除占位） */
.product-card.filtered {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.product-card.is-hidden {
  display: none;
}

.product-card .product-img {
  height: clamp(150px, 17vw, 220px);
  background: linear-gradient(135deg, var(--grad, var(--color-bg-alt), #dbeafe));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(36px, 4.4vw, 48px);
}

.product-card .product-info {
  padding: clamp(16px, 2vw, 20px);
}

.product-card h3 {
  font-size: clamp(16px, 1.6vw, 18px);
  margin-bottom: 6px;
}

.product-card p {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.product-tag {
  display: inline-block;
  padding: 3px 12px;
  background: var(--color-accent-bg);
  color: var(--color-primary);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- 联系页 ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 60px);
}

.contact-info h2 {
  font-size: clamp(22px, 2.9vw, 32px);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.35;
}

.contact-info > p {
  color: var(--color-text-light);
  margin-bottom: 32px;
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-detail .icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--color-accent-bg);
  font-size: 20px;
}

.contact-detail h4 {
  font-size: 16px;
  margin-bottom: 2px;
}

.contact-detail p {
  font-size: 14px;
  color: var(--color-text-light);
}

/* 表单 */
.contact-form {
  padding: clamp(22px, 3.4vw, 36px);
  box-shadow: var(--shadow-lg);
}

.form-title {
  font-size: clamp(19px, 2.2vw, 22px);
  font-weight: 700;
  margin-bottom: clamp(18px, 2.6vw, 24px);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  /* 保持 16px，避免 iOS Safari 聚焦时自动放大页面 */
  font-size: 16px;
  line-height: 1.5;
  font-family: var(--font-family);
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--color-bg-alt);
}

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

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

.form-group .error-msg {
  font-size: 13px;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

.form-group.error input,
.form-group.error textarea {
  border-color: var(--color-error);
}

.form-group.error .error-msg {
  display: block;
}

.form-success {
  display: none;
  text-align: center;
  padding: 40px;
}

.form-success.show {
  display: block;
}

.form-success-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.form-success-title {
  margin-bottom: 8px;
}

.form-success-text {
  color: var(--color-text-light);
}

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  right: calc(24px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.9);
  transition: opacity var(--transition), transform 0.25s var(--ease-out),
    visibility 0s linear 0.3s, background-color var(--transition);
  z-index: 999;
  touch-action: manipulation;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity var(--transition), transform 0.25s var(--ease-out),
    visibility 0s, background-color var(--transition);
}

.back-to-top:hover {
  background: var(--color-primary-dark);
}

.back-to-top:active {
  transform: translateY(0) scale(0.92);
}

/* ---------- 滚动动画 ---------- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: none;
}

/* 同组卡片轻微错峰入场，滚动时更连贯 */
.services-grid > :nth-child(2),
.cases-grid > :nth-child(2),
.products-grid > :nth-child(2),
.testimonials > :nth-child(2),
.team-grid > :nth-child(2) {
  transition-delay: 0.08s;
}

.services-grid > :nth-child(3),
.cases-grid > :nth-child(3),
.products-grid > :nth-child(3),
.testimonials > :nth-child(3),
.team-grid > :nth-child(3) {
  transition-delay: 0.16s;
}

.services-grid > :nth-child(4),
.products-grid > :nth-child(4),
.team-grid > :nth-child(4) {
  transition-delay: 0.24s;
}

/* ============================================
   响应式
   说明：字号、间距、图片高度已由 clamp() 流式缩放，
        媒体查询只负责布局结构（列数、菜单形态）切换
   ============================================ */

/* 平板 (≤992px) */
@media (max-width: 992px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .about-content,
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

/* 手机 (≤768px) */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  /* 抽屉式菜单：位移 + 淡入淡出，避免生硬闪现 */
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    flex-direction: column;
    align-items: stretch;
    padding: 12px var(--gutter) 24px;
    gap: 0;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s var(--ease-out), opacity 0.25s var(--ease),
      visibility 0s linear 0.35s;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.35s var(--ease-out), opacity 0.25s var(--ease),
      visibility 0s;
  }

  /* 整行可点，触控热区 ≥44px */
  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: 12px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--color-bg-alt);
  }

  .nav-menu li:last-child a {
    border-bottom: none;
  }

  .nav-menu a::after {
    display: none;
  }

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

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

  .stats-grid {
    gap: 8px;
  }

  /* 单列后卡片变宽，同步提高图片高度保持比例 */
  .case-card img {
    height: clamp(200px, 50vw, 260px);
  }

  .product-card .product-img {
    height: clamp(180px, 44vw, 240px);
  }

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

  .footer-bottom {
    font-size: 12px;
  }

  .footer-bottom .beian {
    gap: 8px;
  }

  .footer-bottom a {
    font-size: 12px;
  }

  .product-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 9px 16px;
    font-size: 13px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  /* 联系页面移动端优化 */
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .contact-info {
    text-align: center;
  }
  
  .contact-detail {
    justify-content: center;
  }
  
  .contact-form {
    padding: 20px;
  }
  
  .form-title {
    font-size: 18px;
    text-align: center;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px;
    padding: 14px 16px;
  }
  
  .btn-block {
    width: 100%;
    padding: 16px;
    font-size: 16px;
  }
}

/* 小手机 (≤480px) */
@media (max-width: 480px) {
  .team-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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

  .case-card img {
    height: 220px;
  }
  
  /* 联系页面小屏优化 */
  .contact-form {
    padding: 16px;
  }
  
  .form-title {
    font-size: 17px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 12px 14px;
    font-size: 15px;
  }
  
  /* 仪表盘小屏优化 */
  .hero-stat {
    padding: 14px;
  }
  
  .hs-num {
    font-size: 22px;
  }
  
  .welcome-text h1 {
    font-size: 17px;
  }
}

/* 超小屏幕 (≤360px) */
@media (max-width: 360px) {
  .contact-form {
    padding: 14px;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .btn-block {
    padding: 14px;
    font-size: 15px;
  }
}

/* 触屏设备：取消 hover 位移，避免点击后卡片"粘"在悬浮态；
   案例遮罩改为常显，保证无 hover 时文字信息依然可见 */
@media (hover: none) {
  .service-card:hover,
  .team-card:hover,
  .product-card:hover,
  .case-card:hover,
  .card-lift:hover {
    transform: none;
    box-shadow: var(--shadow);
  }

  .case-card:hover img {
    transform: none;
  }

  .case-overlay {
    opacity: 1;
    transform: none;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0) 58%);
  }
}

/* 消除移动端按钮点击的 300ms 等待感 */
.btn,
.filter-btn,
.nav-toggle {
  touch-action: manipulation;
}

.btn:active,
.filter-btn:active {
  transform: translateY(1px) scale(0.99);
}

/* 宽屏 (≥1440px)：适度加大容器与留白 */
@media (min-width: 1440px) {
  :root {
    --max-width: 1280px;
    --space-section: 110px;
  }
}

/* 桌面端细滚动条 */
@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  ::-webkit-scrollbar-track {
    background: var(--color-bg-alt);
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
    border: 2px solid var(--color-bg-alt);
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-light);
  }
}

/* 无障碍：用户开启"减少动态效果"时全部降级 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .nav-menu {
    transition: none;
  }
}

/* ===== 2026-11 优化补充（表单提示 / 空状态） ===== */
.form-tip { font-size: 12px; color: #94a3b8; line-height: 1.7; margin: 10px 0 0; }
.muted { color: #94a3b8; }
.form-group.error input,
.form-group.error textarea,
.form-group.error select { border-color: #ef4444; }
