/* ============================================
   主样式 - 通用布局
   ============================================ */

/* ---------- 工具类 ---------- */
.container {
  width: 100%;
  max-width: var(--w-container);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.container-wide {
  max-width: var(--w-wide);
}
.section {
  padding: var(--sp-24) 0;
  position: relative;
}
.section-sm { padding: var(--sp-16) 0; }
.section-soft { background: var(--c-bg-soft); }
.section-dark {
  background: var(--c-bg-dark);
  color: var(--c-text-inverse);
}

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.text-gradient-warm {
  background: var(--grad-warm);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- 节标题 ---------- */
.section-head {
  text-align: center;
  margin-bottom: var(--sp-16);
}
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: var(--c-primary-50);
  color: var(--c-primary-600);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--sp-4);
}
.section-eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-primary-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
.section-dark .section-eyebrow {
  background: rgba(96, 165, 250, 0.12);
  color: var(--c-primary-300);
}
.section-title {
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-4);
}
.section-subtitle {
  font-size: var(--fs-md);
  color: var(--c-text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: var(--lh-relaxed);
}
.section-dark .section-subtitle { color: var(--c-gray-300); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--t-base);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}
.btn-lg { padding: 16px 32px; font-size: var(--fs-md); }
.btn-sm { padding: 8px 16px; font-size: var(--fs-sm); }

.btn-primary {
  background: var(--grad-primary);
  color: var(--c-white);
  box-shadow: 0 4px 14px -2px rgba(37,99,235,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(37,99,235,0.5);
  color: var(--c-white);
}

.btn-accent {
  background: var(--grad-warm);
  color: var(--c-white);
  box-shadow: 0 4px 14px -2px rgba(245,158,11,0.4);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(245,158,11,0.5);
  color: var(--c-white);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-primary);
  border-color: var(--c-border);
}
.btn-ghost:hover {
  background: var(--c-bg-soft);
  border-color: var(--c-primary-500);
  color: var(--c-primary-500);
}

.btn-glass {
  background: rgba(255,255,255,0.08);
  color: var(--c-white);
  backdrop-filter: blur(12px);
  border-color: rgba(255,255,255,0.18);
}
.btn-glass:hover {
  background: rgba(255,255,255,0.16);
  color: var(--c-white);
}

.btn .arrow {
  transition: transform var(--t-base);
}
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: all var(--t-base);
}
.site-header.is-scrolled {
  background: rgba(255,255,255,0.95);
  border-bottom-color: var(--c-border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: var(--fs-lg);
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-mark:hover svg { transform: rotate(90deg); transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.brand-name { color: var(--c-gray-900); letter-spacing: 0.01em; }
.brand-name strong { color: #4a6b30; font-weight: 800; }

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-gray-700);
  transition: all var(--t-fast);
}
.nav-item:hover,
.nav-item.is-active {
  color: var(--c-primary-500);
  background: var(--c-primary-50);
}
.nav-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  /* reset.css 里 svg{fill:currentColor} 会覆盖标签上的 fill="none"，这里用更高优先级显式置空，
     保证线性图标按描边渲染而非被填充成实心块 */
  fill: none;
  opacity: 0.7;
  transition: opacity var(--t-fast);
}
.nav-item:hover .nav-ico,
.nav-item.is-active .nav-ico { opacity: 1; }

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 1024px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ---------- 卡片基础 ---------- */
.card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: all var(--t-base);
}
.card:hover {
  border-color: var(--c-primary-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--c-primary-900);
  color: var(--c-gray-300);
  padding: var(--sp-20) 0 var(--sp-8);
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-primary-500), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: var(--sp-12);
  margin-bottom: var(--sp-16);
}
.footer-brand .brand-name { color: var(--c-white); }
.footer-brand p {
  margin-top: var(--sp-4);
  color: var(--c-gray-400);
  line-height: var(--lh-relaxed);
  font-size: var(--fs-sm);
}
.footer-col h4 {
  font-size: var(--fs-base);
  color: var(--c-white);
  margin-bottom: var(--sp-4);
}
.footer-col ul li {
  margin-bottom: var(--sp-3);
}
.footer-col ul a {
  display: block;
  color: var(--c-gray-400);
  font-size: var(--fs-sm);
  transition: color var(--t-fast);
}
.footer-col ul a:hover { color: var(--c-primary-300); }
.footer-col ul a .fl-name { display: block; }
.footer-col ul a .fl-sub {
  display: block;
  margin-top: 1px;
  font-size: var(--fs-xs);
  line-height: var(--lh-snug);
  color: var(--c-gray-500);
}
.footer-col ul a:hover .fl-sub { color: var(--c-gray-400); }

.footer-contact-item {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  color: var(--c-gray-400);
}
.footer-contact-item .label { color: var(--c-gray-500); min-width: 64px; }
.footer-contact-item .value { color: var(--c-white); font-weight: 500; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--sp-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-gray-500);
}
.footer-bottom a { color: var(--c-gray-400); }
.footer-bottom a:hover { color: var(--c-primary-300); }

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- 进入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- 浮动按钮 ---------- */
.float-actions {
  position: fixed;
  right: var(--sp-6);
  bottom: var(--sp-8);
  z-index: var(--z-sticky);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.float-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-white);
  box-shadow: var(--shadow-lg);
  display: grid; place-items: center;
  color: var(--c-primary-500);
  transition: all var(--t-base);
  position: relative;
}
.float-btn:hover {
  background: var(--grad-primary);
  color: var(--c-white);
  transform: translateY(-2px);
}
.float-btn svg { width: 24px; height: 24px; }

/* 浮动按钮 hover 弹出气泡（个人微信 / 电话 / 企业微信） */
.float-btn .float-popover {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
  white-space: nowrap;
  text-align: center;
  color: var(--c-text-primary);
  min-width: 156px;
}
.float-btn .float-popover::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid var(--c-border);
  border-top: 1px solid var(--c-border);
}
.float-btn:hover .float-popover,
.float-btn.is-open .float-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}
.float-btn .float-popover img {
  width: 132px;
  height: 132px;
  display: block;
  margin: 0 auto 10px;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 6px 14px rgba(0,0,0,.08);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}
.float-btn .float-popover .pop-label {
  font-size: var(--fs-xs);
  color: var(--c-text-tertiary);
  margin-top: 2px;
}
.float-btn .float-popover .pop-strong {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--c-primary-600);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-top: 4px;
}
.float-btn.is-wechat { background: #07c160; color: #fff; }
.float-btn.is-wechat:hover { background: #06ad56; color: #fff; transform: translateY(-2px); }
.float-btn.is-phone { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; }
.float-btn.is-phone:hover { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); color: #fff; }
.float-btn.is-wework { background: #1989fa; color: #fff; }
.float-btn.is-wework:hover { background: #1872d4; color: #fff; }
.float-btn.is-mp { background: #1aad19; color: #fff; }
.float-btn.is-mp:hover { background: #149317; color: #fff; transform: translateY(-2px); }
@media (max-width: 768px) {
  .float-actions { right: var(--sp-4); bottom: var(--sp-5); gap: 10px; }
  .float-btn { width: 46px; height: 46px; }
  .float-btn svg { width: 22px; height: 22px; }
  .float-btn .float-popover {
    position: fixed;
    right: var(--sp-4);
    left: var(--sp-4);
    bottom: calc(var(--sp-5) + 56px * 6);
    top: auto;
    transform: none;
    width: auto;
    max-width: 320px;
    margin: 0 auto;
  }
  .float-btn .float-popover::after { display: none; }
  .float-btn:hover .float-popover { transform: none; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .section { padding: var(--sp-16) 0; }
  .section-title { font-size: var(--fs-3xl); }
  .section-head { margin-bottom: var(--sp-10); }
}

/* ===================================================================
 *  移动端深度优化层 (mobile-deep)
 *  写在文件末尾，统一覆盖：导航抽屉、布局降级、touch 友好、防溢出
 *  断点梯度：1024 → 平板，768 → 大手机/小平板，640 → 手机横屏，480 → 手机竖屏
 * =================================================================== */

/* —— 全局：图片/视频/iframe 防溢出 —— */
img, video, iframe, svg { max-width: 100%; }
html, body { overflow-x: hidden; }

/* —— 移动端汉堡菜单：原 CSS 缺 .nav.is-open 规则，点击没反应。修复 —— */
@media (max-width: 1024px) {
  /* 关键修复：去掉 backdrop-filter，否则它会成为 position:fixed 子菜单的包含块，
     导致 .nav.is-open 被困在 65px 高的 header 盒子内塌成一条细带（而非铺满视口）。
     移动端改用不透明背景，无需毛玻璃。 */
  .site-header {
    position: fixed;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav.is-open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    top: 72px;
    left: 0; right: 0;
    bottom: 0;
    background: #fff;
    padding: 20px 20px 40px;
    overflow-y: auto;
    border-top: 1px solid var(--c-border);
    box-shadow: 0 12px 28px -8px rgba(15,23,42,0.18);
    z-index: 9998;
    animation: navSlideDown 0.22s cubic-bezier(0.16,1,0.3,1);
  }
  @keyframes navSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
  .nav.is-open .nav-item {
    gap: 14px;
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    border-bottom: 1px solid var(--c-gray-100);
    color: var(--c-text-primary);
  }
  .nav.is-open .nav-ico { width: 20px; height: 20px; opacity: 0.85; }
  .nav.is-open .nav-item:last-child { border-bottom: 0; }
  .nav.is-open .nav-item:hover,
  .nav.is-open .nav-item.is-active {
    background: var(--c-primary-50);
    color: var(--c-primary-600);
  }
  .menu-toggle {
    border: 1px solid var(--c-border);
    background: var(--c-white);
    color: var(--c-text-primary);
    cursor: pointer;
    transition: all 0.18s ease;
  }
  .menu-toggle.is-open {
    background: var(--c-primary-500);
    color: #fff;
    border-color: var(--c-primary-500);
  }
  .menu-toggle.is-open svg { transform: rotate(90deg); }
  .menu-toggle svg { transition: transform 0.25s ease; }
}

/* —— Header 收紧（≤640 logo+CTA 还得挤得下）—— */
@media (max-width: 640px) {
  .header-inner { height: 64px; padding: 0 16px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-cta { gap: 8px; }
  .header-cta .btn-sm { padding: 7px 12px; font-size: 12.5px; }
  .nav.is-open { top: 64px; }
}
@media (max-width: 380px) {
  .brand-name { display: none; } /* 极窄屏只留 logo + CTA */
}

/* —— Container 内边距收紧 —— */
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
}

/* —— Section padding 进一步收紧 —— */
@media (max-width: 640px) {
  .section { padding: 56px 0; }
  .section-sm { padding: 40px 0; }
  .section-head { margin-bottom: 32px; }
  .section-title { font-size: 24px; line-height: 1.25; }
  .section-subtitle { font-size: 14px; }
}
@media (max-width: 480px) {
  .section { padding: 44px 0; }
  .section-title { font-size: 22px; }
}

/* —— 按钮 touch 友好（min 44×44 推荐尺寸）—— */
@media (max-width: 640px) {
  .btn { min-height: 44px; padding: 12px 20px; }
  .btn-lg { min-height: 50px; padding: 14px 26px; font-size: 15px; }
  .btn-sm { min-height: 36px; }
}

/* —— 按钮组在小屏拉满宽 —— */
@media (max-width: 540px) {
  .cta-actions,
  .hero-actions,
  .page-hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px !important;
  }
  .cta-actions .btn,
  .hero-actions .btn,
  .page-hero-actions .btn { width: 100%; }
}

/* —— 通用 2 列 grid 在小屏改单列（兜底）—— */
@media (max-width: 768px) {
  .highlight-block,
  .highlight-block.reverse,
  .login-cta,
  .stats-grid,
  .footer-contact-list,
  .two-col,
  .split-grid,
  .hero-grid {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
  }
  .highlight-block > * { direction: ltr !important; }
}

/* —— 内联 grid 多列在小屏全部降为单列（兜底）—— */
@media (max-width: 640px) {
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns: repeat(6"],
  [style*="grid-template-columns:repeat(6"] {
    grid-template-columns: 1fr !important;
  }
}
@media (min-width: 641px) and (max-width: 768px) {
  /* 中段：5/6 列降到 2 列，3/4 列降到 2 列 */
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns:repeat(4"],
  [style*="grid-template-columns: repeat(5"],
  [style*="grid-template-columns:repeat(5"],
  [style*="grid-template-columns: repeat(6"],
  [style*="grid-template-columns:repeat(6"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* —— CTA 横幅在小屏字号 —— */
@media (max-width: 640px) {
  .cta-title { font-size: 22px !important; line-height: 1.3; }
  .cta-sub   { font-size: 14px !important; }
  .cta-banner { padding: 36px 22px !important; }
}

/* —— 表单：iOS 字号 ≥16px 防自动缩放、字段触摸友好 —— */
@media (max-width: 640px) {
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }
  textarea { min-height: 96px; }
}

/* —— Demo Modal 小屏全屏化（覆盖 demo-modal.js 注入的内联 css）—— */
@media (max-width: 540px) {
  .kb-demo-mask { padding: 0 !important; align-items: stretch !important; }
  .kb-demo-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
  }
  .kb-demo-head { border-radius: 0 !important; padding: 22px 20px 18px !important; }
  .kb-demo-head h3 { font-size: 18px !important; }
  .kb-demo-body { padding: 18px 20px 4px !important; }
  .kb-demo-foot {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 16px 20px 22px !important;
    gap: 10px;
    border-radius: 0 !important;
  }
  .kb-demo-submit { width: 100%; padding: 14px 20px !important; }
  .kb-demo-row { grid-template-columns: 1fr !important; gap: 12px !important; }
}

/* —— Video modal 小屏适配 —— */
@media (max-width: 640px) {
  .video-modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    margin: 0 auto;
  }
}

/* —— 页脚联系信息小屏排列 —— */
@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-footer { padding-top: 48px; padding-bottom: 24px; }
}

/* —— Tabs 小屏滚动条隐藏 + 横向滚动 —— */
@media (max-width: 768px) {
  .login-tabs, .tabs, .wizard-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .login-tabs::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .wizard-tabs::-webkit-scrollbar { display: none; }
}

/* —— Page Hero（产品/方案页内页 hero）字号梯度 —— */
@media (max-width: 768px) {
  .page-hero-title { font-size: 30px !important; line-height: 1.2; }
  .page-hero-sub   { font-size: 14px !important; }
  .page-hero-stats { gap: 16px !important; }
}
@media (max-width: 480px) {
  .page-hero-title { font-size: 24px !important; }
}

/* —— 表格横向滚动包裹兜底 —— */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* —— 浮动按钮在键盘弹出时不挡内容 —— */
@media (max-width: 480px) {
  .float-actions { bottom: 16px; right: 12px; }
  .float-btn { width: 42px; height: 42px; }
  .float-btn svg { width: 20px; height: 20px; }
}

/* —— hero 区在小屏的兜底 —— */
@media (max-width: 768px) {
  .hero, [class*="hero-section"] { padding-top: 88px; padding-bottom: 40px; }
}

/* —— 防止 cards 内长串文本（URL/邮箱/编码）撑破布局 —— */
.card, .ability-card, .feature-tile, .service-card,
.product-card, .industry-tile, .testimonial-card,
.role-card, .mod-card, .value-card {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
/* ============== 移动端深度优化层 END ============== */
