/* ===== 全局重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== 配色方案：黑白灰极简（与 LineWaves 白色波线背景统一） ===== */
:root {
  --primary: #1A1A1E;       /* 品牌主色：近黑（浅色区域标题用） */
  --primary-dark: #000000;  /* 更深：hover / 强调 */
  --accent: #111114;        /* 强调色：近黑（链接、输入框焦点） */
  --accent-soft: #6E6E76;   /* 中灰：渐变点缀 */
  --accent-sky: #9A9AA2;    /* 辅助点缀：浅灰（深色区块图标用） */
  --gradient: linear-gradient(135deg, #3A3A40 0%, #17171A 100%);

  --text: #26262B;          /* 正文：深灰 */
  --text-muted: #6E6E76;    /* 次要文字 */
  --bg: #FFFFFF;            /* 页面背景 */
  --bg-card: #F7F7F9;       /* 卡片背景：极浅灰 */
  --bg-gray: #F4F4F6;       /* 区块背景：浅灰 */
  --border: #E5E5E9;        /* 边框 */
  --footer-bg: #0C0C0E;     /* 页脚：近黑（比 hero 略深） */
}

body {
  font-family: "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.6;
}

/* ===== 通用容器：限宽居中（大屏最多1200px，小屏不超过92%，自动留边距） ===== */
.container {
  max-width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 导航栏（胶囊圆角条悬浮） ===== */
.header {
  background: transparent;      /* 外层透明，只负责定位 */
  position: fixed;              /* 固定在视口顶部 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;           /* 给胶囊条留出上下边距 */
}
/* 滚动后：外层保持透明，胶囊条过渡为白色微透毛玻璃 */
.header.scrolled .nav {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}
/* 顶部未滚动：深色玻璃胶囊（React Bits 风格），文字用浅色 */
.header:not(.scrolled) .nav {
  background: rgba(16, 18, 26, 0.42);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.10);
}
.header:not(.scrolled) .logo-en {
  color: rgba(255, 255, 255, 0.62);
}
.header:not(.scrolled) .logo-cn {
  color: #ffffff;
}
.header:not(.scrolled) .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}
.header:not(.scrolled) .nav-links a:hover,
.header:not(.scrolled) .nav-links a.active {
  color: #ffffff;
}
/* 锚点跳转时，给各区块顶部留出导航栏高度，避免标题被遮住 */
section[id] {
  scroll-margin-top: 100px;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  margin: 0 auto;               /* ★ 胶囊拉宽：去掉 900px 限制，跟随 .container 宽度（最大 1200px / 92vw） */
  padding: 0 40px;
  background: rgba(16, 18, 26, 0.42);   /* 顶部：深色玻璃胶囊（未滚动态，见上方 .header:not(.scrolled)） */
  backdrop-filter: blur(16px) saturate(160%); /* 毛玻璃 */
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: 50px;          /* ★ 胶囊圆角 */
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.10); /* 细边框勾勒胶囊轮廓 */
  transition: background 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
}
.logo {
  display: flex;
  align-items: center;      /* 图标与文字垂直居中 */
  gap: 12px;                /* 图标和文字之间的间距 */
  text-decoration: none;
}
/* ★ logo 图片：彩色圆环图标，圆形裁切 */
.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;       /* 圆形裁切 */
  object-fit: cover;        /* 图片自动裁剪铺满，不变形 */
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;   /* 英文小字 + 中文大字，上下排列 */
  line-height: 1.2;
}
.logo-en {
  font-size: 14px;
  font-weight: normal;
  color: var(--text-muted);   /* 浅玻璃上用小字灰色 */
  letter-spacing: 2px;
}
.logo-cn {
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: bold;
  color: var(--primary);      /* 公司名用品牌深蓝，醒目 */
}
.nav-links {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);   /* 菜单间距随屏宽缩放 */
}
.nav-links a {
  font-size: clamp(13px, 1.1vw, 15px);
  color: var(--text);         /* 浅玻璃上菜单用深灰，清晰可读 */
  text-decoration: none;      /* ★ 去掉链接默认下划线 */
  transition: color 0.2s;
}
.nav-links a:hover {
  color: var(--accent);
}

/* ===== 下拉菜单（产品服务） ===== */
.dropdown {
  position: relative;          /* 下拉面板以它为定位基准 */
}
.drop-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
}
.caret {
  font-size: 10px;            /* 小三角箭头 */
  transition: transform 0.3s; /* 展开时旋转 */
}
.dropdown:hover .caret {
  transform: rotate(180deg);
}
/* 下拉面板：毛玻璃卡片，默认隐藏，悬停/聚焦时滑出 */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(10px); /* 初始：稍向下偏 */
  min-width: 168px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px) saturate(180%);   /* 毛玻璃 */
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  padding: 8px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;          /* 隐藏（不可点击） */
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 200;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);   /* 滑到原位 */
}
/* 面板顶部的小三角箭头（纯 CSS 画） */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}
.dropdown-menu a {
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;      /* 下拉菜单文字也去掉下划线 */
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
}
.dropdown-menu a:hover {
  background: rgba(17, 17, 20, 0.06);
  color: #111114;
  padding-left: 20px;         /* hover 时文字轻微右移，有动感 */
}

/* ===== 首页 Hero（Hyperspeed 无限公路车灯背景，纯黑底） ===== */
.hero {
  position: relative;           /* 让滚动箭头和流体层/遮罩能定位到它底部 */
  min-height: 100vh;            /* 首屏占满整个视口高度，更大气 */
  display: flex;
  align-items: center;          /* 内容垂直居中 */
  justify-content: center;
  text-align: center;
  padding: 140px 20px 120px;    /* 顶部多留 padding，给胶囊导航栏让位 */
  overflow: hidden;             /* ★ 裁掉画布溢出的部分，防止出现滚动条 */
  /* 黑底兜底背景：WebGL2 不可用时显示的静态近黑渐变（微弱层次，避免死板一块） */
  background:
    radial-gradient(ellipse 60% 50% at 22% 78%, rgba(16, 16, 22, 0.85) 0%, rgba(16, 16, 22, 0) 70%),
    radial-gradient(ellipse 55% 45% at 80% 24%, rgba(10, 10, 14, 0.75) 0%, rgba(10, 10, 14, 0) 70%),
    #030304;
  color: #fff;
}
/* 文字容器：相对定位 + 提高层级，盖在波线层和遮罩上面 */
.hero > .container {
  position: relative;
  z-index: 2;
}
/* ★ Hero 背景层（Hyperspeed 公路 / FloatingLines / GridScan / AstralShell / WebThreads 通用）：
   必须 absolute，否则会以 static 块参与 .hero 的 flex 布局，把居中文字挤到一边 */
.hero-speed,
.hero-lines,
.web-threads {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;                   /* 最底层：背景画布（纯黑底） */
  pointer-events: none;         /* 交互监听挂在 window 上，层本身不拦截点击 */
  background: #000000;
  overflow: hidden;
}
/* 背景画布：铺满容器，首帧渲染完成后淡入 */
.hero-speed .hyperspeed__canvas,
.hero-lines .floating-lines__canvas,
.grid-scan .grid-scan__canvas,
.astral-shell .astral__canvas,
.web-threads .web-threads__canvas {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-speed[data-ready="true"] .hyperspeed__canvas,
.hero-lines[data-ready="true"] .floating-lines__canvas,
.grid-scan[data-ready="true"] .grid-scan__canvas,
.astral-shell[data-ready="true"] .astral__canvas,
.web-threads[data-ready="true"] .web-threads__canvas {
  opacity: 1;
}
/* WebGL 不可用时的兜底背景（画布创建失败时容器带 data-no-gl） */
.hero-speed[data-no-gl],
.hero-lines[data-no-gl],
.web-threads[data-no-gl] {
  background: #030304;
}
/* ★ 轻微暗色渐变遮罩：压在流体之上、文字之下，提升白色标题可读性 */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0.02));
  z-index: 1;                   /* 中间层：遮罩 */
}

.hero h1 {
  font-size: clamp(32px, 6vw, 60px);   /* 最小32px，适中为屏宽6%，最大60px */
  margin-bottom: 16px;
  /* 文字发光：柔和白光三层叠加（黑白灰极简，与白色波线呼应） */
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.30),
    0 0 45px rgba(255, 255, 255, 0.18),
    0 0 90px rgba(255, 255, 255, 0.10);
  animation: glowPulse 3s ease-in-out infinite; /* 呼吸闪烁 */
}
/* 发光呼吸动画：亮度强弱循环 */
@keyframes glowPulse {
  0%, 100% {
    text-shadow:
      0 0 20px rgba(255, 255, 255, 0.30),
      0 0 45px rgba(255, 255, 255, 0.18),
      0 0 90px rgba(255, 255, 255, 0.10);
  }
  50% {
    text-shadow:
      0 0 32px rgba(255, 255, 255, 0.42),
      0 0 70px rgba(255, 255, 255, 0.25),
      0 0 120px rgba(255, 255, 255, 0.14);
  }
}
.hero p {
  font-size: clamp(16px, 2.2vw, 20px);
  margin-bottom: 40px;
}

/* ===== 区块标题 ===== */
.section-title {
  font-size: clamp(22px, 3vw, 32px);
  color: var(--primary);
  text-align: center;
  margin-bottom: 40px;
}

/* ===== 产品服务 ===== */
.products {
  padding: 80px 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: -16px auto 36px;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.7;
}
.grid {
  display: grid;
  gap: 24px;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 24px;
  text-align: center;
  transition: box-shadow 0.3s, transform 0.3s;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-4px);
}
.card h3 {
  font-size: 20px;
  color: var(--primary);
  margin-bottom: 12px;
}
.card p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ===== 为什么选择我们（浅色版） ===== */
.why-us {
  padding: 80px 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7F7F9 100%);
  color: #16161A;
}

.why-us-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;   /* 左右两栏等宽 */
  gap: 60px;
  max-width: 1100px;
  margin: 0 auto;
  align-items: start;
}

/* 左侧 */
.why-us-label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(0,0,0,0.45);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.why-us-title {
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 700;
  margin-bottom: 20px;
  color: #16161A;
}

.why-us-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(0,0,0,0.65);
  margin-bottom: 32px;
}

.why-us-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.why-us-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
}

.why-us-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 4px;
  background: #16161A;            /* 近黑勾选框（浅色区块内做强调） */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-top: 2px;
}

.why-us-check svg {
  width: 14px;
  height: 14px;
}

.why-us-list h4 {
  font-size: 16px;
  font-weight: 600;
  color: #16161A;
  margin-bottom: 6px;
}

.why-us-list p {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(0,0,0,0.6);
  margin: 0;
}

/* 右侧：统计卡片 */
.why-us-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);   /* 白底区块内用细边框区分卡片 */
  border-radius: 8px;
  padding: 20px 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}

.stat-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 8px;
  background: #F2F2F5;            /* 浅灰底色 */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #55555C;                 /* 中灰图标 */
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  color: #1F1F24;                  /* 近黑数字 */
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: #76767E;                  /* 灰色描述 */
  margin-top: 2px;
}

/* ===== 响应式：手机端 ===== */
@media (max-width: 768px) {
  .why-us-grid {
    grid-template-columns: 1fr;    /* 手机端变一列 */
    gap: 40px;
  }
  .why-us-title {
    font-size: 24px;
  }
}


/* ===== 联系我们（三栏页脚风格） ===== */
.contact {
  padding: 60px 20px;
  background: #131317;            /* 深灰背景（黑白灰极简） */
  color: #fff;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;  /* 左宽 中窄 右适中 */
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
}

/* 左栏：品牌 + 简介 + 社交 */
.contact-brand .contact-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.contact-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.contact-logo-text {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.contact-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}
.contact-social {
  display: flex;
  gap: 12px;
}
.contact-social a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.contact-social a:hover {
  background: rgba(255,255,255,0.22);  /* 白色半透明 hover */
  transform: translateY(-2px);
}
.contact-social svg {
  width: 18px;
  height: 18px;
}

/* 中栏 & 右栏：标题 + 列表 */
.contact-col h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.contact-links ul,
.contact-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-links li {
  margin-bottom: 12px;
}
.contact-links a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
  display: inline-block;
}
.contact-links a:hover {
  color: #fff;
  padding-left: 4px;
}
.contact-info li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
.contact-info li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #9A9AA2;                 /* 浅灰图标色 */
}

/* 联系表单（保留在页脚上方或单独区域） */
.contact-form-section {
  padding: 60px 20px;
  background: var(--bg-gray);
}
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.form input,
.form textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form textarea {
  height: 120px;
  resize: vertical;
}
.form-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: -28px 0 32px;
}

/* ===== 加入我们 ===== */
.join {
  padding: 80px 20px;
  background: var(--bg-gray);
  text-align: center;
}
.join p {
  font-size: 16px;
  color: var(--text-muted);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 14px 40px;
  border: none;
  border-radius: 50px;          /* 胶囊按钮，和导航栏呼应 */
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  font-weight: 500;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); /* 深灰投影 */
}
.btn-primary {
  background: var(--gradient); /* 深灰→近黑渐变按钮（黑白灰极简） */
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #26262B 0%, #060607 100%); /* 深一档 hover */
}

/* ===== 向下滚动引导（鼠标滚轮样式） ===== */
.scroll-hint {
  position: absolute;           /* 钉在 Hero 底部居中 */
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.85;
  transition: opacity 0.3s;
}
.scroll-hint:hover {
  opacity: 1;
}
/* "鼠标"外框：圆角矩形 + 半透明白边框 */
.mouse {
  display: block;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 14px;
  position: relative;
}
/* "滚轮"小点：白色圆点，上下循环浮动 */
.mouse::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 2px;
  animation: scrollWheel 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(16px); }
}
.contact .btn-primary {
  background: var(--primary);
  color: #fff;
}

/* ===== 页脚 ===== */
.footer {
  background: #0C0C0E;            /* 比 contact 更深：近黑 */
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
}

/* =====================================================
   「关于光启智元」模板式区块（浅色版）
   - 白/浅灰底、深字
   - 大标题 + 描述段落 + 底部概念插图
   ===================================================== */
.template-meta {
  padding: 100px 20px 80px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0, 0, 0, 0.02) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 0, 0, 0.015) 0%, transparent 60%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F7F9 50%, #FFFFFF 100%);
  color: #16161A;
  position: relative;
  overflow: hidden;
}
.template-meta__inner {
  max-width: 1100px;
}
.template-meta__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
  text-shadow: none;
}
.template-meta__desc {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.72);
  line-height: 1.8;
  max-width: 760px;
  margin: 0 0 18px;
}
/* ===== TechText 虚线描边科技字（React Bits 移植版，js/tech-text.js） ===== */
/* 容器：浅色区块内继承 currentColor 作墨色；高度给足，字号自适应由 JS 测量完成 */
.tech-text {
  position: relative;
  height: 210px;                /* 桌面端画布高度（文字在画布内垂直居中，留出弹跳余量） */
  margin-top: 0;
  border-radius: 20px;
  overflow: hidden;
  touch-action: none;           /* 允许拖拽字符/点击弹跳的 pointer 手势 */
}
.tech-text .tech-text-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
@media (max-width: 768px) {
  .tech-text { height: 170px; }
}

/* ===== 滑动淡入动画（配合 js/app.js 的 .reveal 观察器） ===== */
.reveal {
  opacity: 0;
  transform: translateY(36px);             /* 从下方滑入，与上下区块滚动方向一致 */
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* 延迟变体：副标题跟在标题后面，错落浮现 */
.reveal--delay { transition-delay: 0.18s; }
/* 延迟变体：画廊再晚一拍，形成 标题→副标题→画廊 的级联 */
.reveal--delay-2 { transition-delay: 0.36s; }
/* 尊重系统"减少动态效果"设置：直接显示 */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== 图片轮播 / AccordionGallery 手风琴画廊 ===== */
.carousel-section {
  padding: 60px 20px;
  /* 浅灰渐变背景：让毛玻璃边框的磨砂效果可见 */
  background: linear-gradient(180deg, #F7F7F9 0%, #F2F2F5 100%);
}

/* ---- AccordionGallery：水平手风琴，悬停的面板展开 ---- */
.accordion-gallery {
  --ag-active-grow: 1.92;                 /* 展开项的 flex 权重（JS 按 expand-ratio 写入） */
  display: flex;
  gap: 10px;
  height: 560px;                          /* 画廊高度：图片按 cover 裁切 */
  margin-top: 36px;
}
.ag__item {
  position: relative;
  flex: 1 1 0;                            /* 所有面板平分剩余宽度 */
  min-width: 64px;
  overflow: hidden;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  background: #26262B;
  outline: none;
  transition: flex-grow 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}
.ag__item.is-active {
  flex-grow: var(--ag-active-grow);       /* 悬停/选中的面板展开 */
}
/* 面板图片：收起时灰度压暗 + 轻微放大，展开时恢复彩色原比例 */
.ag__item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.7) brightness(0.72);
  transform: scale(1.04);
  transition: filter 0.65s ease, transform 0.65s ease;
  user-select: none;
  -webkit-user-drag: none;
}
.ag__item.is-active img {
  filter: none;
  transform: scale(1);
}
/* 底部渐变遮罩：收起时较深（突出竖排标签），展开时减淡（露出完整大图） */
.ag__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.55) 100%);
  transition: background 0.65s ease;
  pointer-events: none;
}
.ag__item.is-active .ag__veil {
  background: linear-gradient(180deg, rgba(0,0,0,0.00) 45%, rgba(0,0,0,0.55) 100%);
}
/* 收起面板的竖排标签（左侧） */
.ag__label {
  position: absolute;
  left: 14px;
  bottom: 14px;
  writing-mode: vertical-rl;              /* 竖排：汉字直立，自上而下阅读 */
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transition: opacity 0.35s ease;
}
.ag__item.is-active .ag__label { opacity: 0; }
/* 序号（右上角） */
.ag__num {
  position: absolute;
  top: 12px;
  right: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
/* 展开面板的横排标题（左下角，随展开淡入） */
.ag__title {
  position: absolute;
  left: 20px;
  bottom: 18px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease 0.12s, transform 0.45s ease 0.12s;
  pointer-events: none;
}
.ag__item.is-active .ag__title {
  opacity: 1;
  transform: translateY(0);
}
/* 键盘聚焦可见性 */
.ag__item:focus-visible {
  box-shadow: 0 0 0 3px rgba(17, 17, 20, 0.55);
}
/* 小屏：改为纵向手风琴（上下开合） */
@media (max-width: 768px) {
  .accordion-gallery {
    flex-direction: column;
    height: auto;
    gap: 8px;
  }
  .ag__item {
    flex: 0 0 88px;                       /* 收起高度 */
    min-width: 0;
    width: 100%;
    transition: flex-basis 0.65s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .ag__item.is-active {
    flex-basis: 340px;                    /* 展开高度 */
    flex-grow: 0;
  }
  .ag__label {
    writing-mode: horizontal-tb;
    transform: none;
    left: 16px;
    bottom: 12px;
    max-width: calc(100% - 60px);        /* 长标题在窄条内截断，避免压到右上角序号 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ag__title {
    font-size: 18px;
    left: 16px;
    bottom: 14px;
    max-width: calc(100% - 32px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.carousel {
  position: relative;           /* 让箭头/圆点能定位到它上面 */
  max-width: 1000px;
  margin: 0 auto;
  overflow: hidden;             /* ★ 关键1：窗口，多出的图藏起来 */
  border-radius: 24px;
  /* ★ 毛玻璃边框：半透明白 + 背景模糊，像磨砂玻璃相框 */
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  padding: 14px;                /* 图片和玻璃边缘留白，形成相框效果 */
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
}

.carousel-track {
  display: flex;                /* ★ 关键2：所有图横排成一行 */
  transition: transform 0.5s ease; /* ★ 关键3：平移时有滑动动画 */
}

.carousel-slide {
  flex: 0 0 100%;              /* 每张图正好占满窗口宽度 */
}

.carousel-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;            /* 图片自动裁剪铺满，不变形 */
  display: block;
  border-radius: 12px;          /* 图片内圆角，贴合玻璃相框 */
}

/* ★ 本地视频 slide：和图片同样的尺寸/圆角 */
.carousel-slide video {
  width: 100%;
  height: 420px;
  object-fit: cover;            /* 视频自动裁剪铺满，不变形 */
  display: block;
  border-radius: 12px;          /* 内圆角，和图片一致 */
  background: #000;             /* 视频加载前黑色底，避免空白 */
}

/* ★ B站等网络视频（iframe）slide：宽度铺满、圆角统一 */
.carousel-slide iframe {
  width: 100%;
  height: 420px;
  border: 0;                   /* 去掉 iframe 默认边框 */
  border-radius: 12px;         /* 内圆角，和图片一致 */
  display: block;
}

/* 左右箭头按钮 */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  color: var(--primary);
  font-size: 20px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.2s;
}
.carousel-btn:hover {
  background: #fff;
}
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

/* 底部圆点 */
.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}
.carousel-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}
.carousel-dots .dot.active {
  background: #fff;
}

/* ===== 响应式：平板/小笔记本（1024px 及以下，新增档位） ===== */
@media (max-width: 1024px) {
  .why-us-grid {
    grid-template-columns: 1fr;    /* 两栏变一栏 */
    gap: 40px;
  }
  .contact-grid {
    grid-template-columns: 1fr;    /* 三栏变一栏 */
    gap: 36px;
    text-align: center;
  }
  .contact-brand .contact-logo {
    justify-content: center;
  }
  .contact-social {
    justify-content: center;
  }
  .contact-info li {
    justify-content: center;
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);   /* 三列变两列 */
  }
  .carousel-slide img,
  .carousel-slide video,
  .carousel-slide iframe {
    height: 320px;               /* 平板：视频/图片高度适中 */
  }
}

/* ===== 子页面通用：页头横幅 / 卡片（page-hero 等） ===== */
/* 当前页导航高亮 */
.nav-links a.active {
  color: var(--accent);
  font-weight: 600;
}

/* 页头横幅：比首页 Hero 矮，半屏高度，深色遮罩让文字清晰 */
.page-hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 160px 20px 80px;    /* 顶部多留 padding，给固定导航让位 */
  background:
    linear-gradient(rgba(10, 10, 12, 0.55), rgba(10, 10, 12, 0.40)),
    url('../images/page-hero-bg.jpg') center / cover no-repeat;
  color: #fff;
}
.page-hero h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  margin-bottom: 16px;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.35),
    0 0 45px rgba(255, 255, 255, 0.2);
}
.page-hero p {
  font-size: clamp(14px, 1.8vw, 18px);
  color: rgba(255, 255, 255, 0.85);
}

/* 产品卡片：顶部加渐变图标，增强视觉 */
.product-card {
  padding: 36px 28px 32px;
}
.product-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 16px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.product-icon svg {
  width: 26px;
  height: 26px;
}

/* 卡片里的"了解详情"小按钮 */
.btn-sm {
  margin-top: 18px;
  padding: 10px 28px;
  font-size: 14px;
}

/* ===== 响应式：手机端 ===== */
@media (max-width: 768px) {
  .header {
    padding: 10px 12px;
  }
  .nav {
    flex-direction: column;
    height: auto;
    padding: 10px 20px;
    gap: 6px;
    border-radius: 24px;        /* 手机端圆角稍小 */
  }
  .nav-links {
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .nav-links a {
    font-size: 13px;
  }
  .logo-cn {
    font-size: 16px;
  }
  .logo-icon,
  .logo-img {
    width: 36px;            /* 手机端图标稍小一点 */
    height: 36px;
    font-size: 16px;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 28px;
  }
  .carousel-slide img,
  .carousel-slide video,
  .carousel-slide iframe {
    height: 220px;
  }
  .scroll-hint {
    display: none;              /* 手机端空间紧张，隐藏滚动引导 */
  }
  .dropdown-menu,
  .caret {
    display: none;              /* 手机端隐藏下拉菜单，避免挤爆导航 */
  }
  /* 联系页脚：手机端三栏变一列 */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }
  .contact-brand .contact-logo {
    justify-content: center;
  }
  .contact-social {
    justify-content: center;
  }
  .contact-info li {
    justify-content: center;
  }
}

/* ===== MagicBento 产品与服务卡片（零依赖移植，浅色版） ===== */
.products--bento {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F5F7 100%);
}
.products--bento .section-title { color: var(--primary); }

.magic-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  perspective: 1000px;               /* 供子卡片 3D 倾斜 */
}
.mb__card {
  position: relative;
  display: block;
  min-height: 210px;
  padding: 28px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
  text-decoration: none;
  transform: translateZ(0);
  transform-style: preserve-3d;
  will-change: transform;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.mb__card:hover {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
}
.mb__card--wide { grid-column: span 2; }

/* 跟随光标的边框流光（mask-composite 只留边框） */
.mb__card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(
    240px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(var(--glow-rgb, 90, 90, 95), 0.6),
    transparent 70%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: var(--hover, 0);
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 2;
}
/* 跟随光标的聚光灯（浅色底：用深色柔光） */
.mb__card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    300px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(0, 0, 0, 0.05),
    transparent 62%
  );
  opacity: var(--hover, 0);
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}
.mb__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.mb__content {
  position: relative;
  z-index: 3;
  opacity: var(--text-o, 1);
  transition: opacity 0.35s ease;
}
.mb__content h3 {
  font-size: 20px;
  color: #16161A;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}
.mb__content p {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .magic-bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .magic-bento { grid-template-columns: 1fr; }
  .mb__card--wide { grid-column: auto; }
  .mb__card { min-height: 170px; }
}
