/* ==========================================================================
   众致电机 (ZZMOTOR) - 现代工业品牌官网核心样式表
   主色调：科技深蓝 (#0f172a) / 品牌皇家蓝 (#2563eb) / 精密天蓝 (#0ea5e9)
   ========================================================================== */

:root {
  --zz-primary: #2563eb;
  --zz-primary-dark: #1d4ed8;
  --zz-primary-light: #3b82f6;
  --zz-accent: #0ea5e9;
  --zz-navy: #0f172a;
  --zz-slate: #334155;
  --zz-bg-soft: #f8fafc;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: #1e293b;
  background-color: #ffffff;
}

/* 工业精密网格背景纹理 */
.bg-industrial-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(37, 99, 235, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
}

/* 多场景轮播 Banner 背景图层（平滑交叉淡入淡出 + 电影感微缩放 Ken Burns 效果） */
.hero-bg-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.0);
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  z-index: 1;
}

.hero-bg-layer.active {
  opacity: 1;
  transform: scale(1.06);
  z-index: 2;
}

/* 底部轮播 Tab 读秒进度条动画 */
.hero-tab-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #60a5fa);
  border-radius: 0 0 12px 12px;
}

.hero-tab-btn.active-tab .hero-tab-progress {
  animation: heroTabProgress 6.5s linear forwards;
}

@keyframes heroTabProgress {
  from { width: 0%; }
  to { width: 100%; }
}

/* 轮播容器：使用 CSS Grid 同格堆叠技术，自动取最高一屏高度，彻底消除切换时的页面高度抖动 */
.hero-slides-stack {
  display: grid;
  grid-template-columns: 100%;
  align-items: center;
}

.hero-slide-item {
  grid-area: 1 / 1 / 2 / 2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.55s;
  pointer-events: none;
  z-index: 1;
}

.hero-slide-item.active-slide {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 2;
}

/* ==========================================================================
   主导航栏全局跟随滚动 (Sticky Navigation Header for Desktop & Mobile)
   ========================================================================== */
#main-header {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 50 !important;
}

/* 顶部导航栏玻璃拟态与过渡 */
.navbar-glass {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-scrolled {
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.98);
}

/* 移动端展开菜单在跟随滚动时自适应屏幕高度，防止底部项目被截断 */
#mobile-menu {
  max-height: calc(100vh - 4.5rem);
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 导航下拉菜单（产品展示 Mega/Dropdown） */
.nav-dropdown-wrapper {
  position: relative;
}

.nav-dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.nav-dropdown-wrapper:hover .nav-dropdown-menu,
.nav-dropdown-wrapper:focus-within .nav-dropdown-menu,
.nav-dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dropdown-wrapper:hover .dropdown-chevron {
  transform: rotate(180deg);
}

/* 产品卡片悬停光效 */
.product-card {
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 38px -12px rgba(37, 99, 235, 0.16);
  border-color: rgba(37, 99, 235, 0.45);
}

/* FAQ 手风琴过渡 */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 1600px;
}

.faq-item.open .faq-icon,
.faq-item.open .faq-icon-box {
  transform: rotate(180deg);
  background-color: #2563eb;
  color: #ffffff;
}

/* 规格参数表横向滚动条美化 */
.custom-scrollbar::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* ==========================================================================
   规格参数表响应式适配（桌面端横向宽表 + 手机端双栏参数卡片化展示，防止竖向单字挤压）
   ========================================================================== */
@media (min-width: 768px) {
  .spec-responsive-table {
    min-width: 880px;
  }
  .spec-responsive-table th,
  .spec-responsive-table td:not(.spec-col-full) {
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .spec-responsive-table,
  .spec-responsive-table tbody {
    display: block;
    width: 100%;
  }

  .spec-responsive-table thead {
    display: none;
  }

  .spec-responsive-table tbody {
    padding: 12px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .spec-responsive-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 8px 10px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 6px -1px rgba(15, 23, 42, 0.05);
  }

  .spec-responsive-table tbody td {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px 10px !important;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    text-align: left !important;
    font-size: 12.5px;
    line-height: 1.45;
    word-break: break-word;
  }

  .spec-responsive-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 3px;
    display: block;
    letter-spacing: 0.01em;
  }

  /* 第一列（主型号）：在手机卡片顶部独占整行并高亮展示 */
  .spec-responsive-table tbody td:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    padding: 9px 12px !important;
    font-size: 14px;
  }

  .spec-responsive-table tbody td:first-child::before {
    margin-bottom: 0;
    color: #1e40af;
    font-weight: 700;
    background: #dbeafe;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
  }

  /* 长文本列（增值配置 / 结构形式 / 典型应用设备）：在手机卡片内占满整行，彻底告别竖排挤压 */
  .spec-responsive-table tbody td.spec-col-full {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   CMS 标准分页组件样式 (.pagination / .page-item / .prev-next / .active)
   完全适配 PHPCMS / CI / 迅睿 / PbootCMS 等后台原生分页 HTML 输出
   ========================================================================== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2.5rem;
  user-select: none;
}

.pagination .page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.pagination .page-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 14px;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}

.pagination .page-item.prev-next {
  min-width: auto;
}

.pagination .page-item.prev-next a {
  padding: 0 16px;
}

.pagination .page-item:hover:not(.active) {
  border-color: #2563eb;
  color: #2563eb;
  background-color: #eff6ff;
  transform: translateY(-1px);
}

.pagination .page-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #0284c7 100%);
  border-color: #2563eb;
  color: #ffffff;
  padding: 0 14px;
  box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.4);
}

@media (max-width: 640px) {
  .pagination {
    gap: 6px;
    margin-top: 1.75rem;
  }

  .pagination .page-item {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .pagination .page-item a,
  .pagination .page-item.active {
    padding: 0 10px;
  }

  .pagination .page-item.prev-next a {
    padding: 0 12px;
  }
}

/* ==========================================================================
   新闻详情页 CMS 富文本正文排版 (.article-content)
   支持后台富文本编辑器直接输出的 h2/h3/p/ul/ol/blockquote/table 标签自适应美化
   ========================================================================== */
.article-content {
  color: #334155;
  font-size: 15.5px;
  line-height: 1.85;
}

.article-content h2 {
  color: #0f172a;
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  padding-left: 0.85rem;
  border-left: 4px solid #2563eb;
  line-height: 1.4;
  scroll-margin-top: 100px;
}

/* 文章正文全局 h2 锚点偏移与侧边栏目录高亮 */
article h2 {
  scroll-margin-top: 100px;
}

.toc-link.active-toc-item {
  color: #2563eb !important;
  font-weight: 700 !important;
  background-color: #eff6ff !important;
  border-left: 3px solid #2563eb !important;
  padding-left: 0.75rem !important;
}

.article-content h3 {
  color: #1e293b;
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1.6rem;
  margin-bottom: 0.75rem;
}

.article-content p {
  margin-bottom: 1.15rem;
}

.article-content ul,
.article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.4rem;
}

.article-content ul {
  list-style-type: disc;
}

.article-content ol {
  list-style-type: decimal;
}

.article-content li {
  margin-bottom: 0.45rem;
}

.article-content strong {
  color: #0f172a;
  font-weight: 700;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background-color: #f8fafc;
  border-left: 4px solid #0ea5e9;
  border-radius: 0 12px 12px 0;
  color: #475569;
  font-size: 0.95rem;
}

.article-content code {
  background-color: #f1f5f9;
  color: #1d4ed8;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
}


/* ==========================================================================
   众致电机 (ZZMOTOR) - 全局技术数据规格表与性能计算器统一现代化样式表
   确保全站 154 个规格页面、步进/无刷/减速全品类表格质感 100% 现代统一
   ========================================================================== */

/* 1. 规格表格外层容器包装 */
.spec-table-container {
  border-radius: 1.25rem !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
  background-color: #ffffff !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* 2. 表格全局重置与字体统一 */
.spec-table-container table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  text-align: center !important;
  background-color: #ffffff !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif !important;
}

/* 3. 表头样式统一：高级科技深蓝渐变 + 纯白高对比字体 */
.spec-table-container thead,
.spec-table-container table > thead > tr,
.spec-table-container table tr:first-child th,
.spec-table-container thead th {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 0.025em !important;
  padding: 12px 14px !important;
  border: 1px solid #1e293b !important;
  white-space: nowrap !important;
}

.spec-table-container thead th span,
.spec-table-container table tr:first-child th span {
  font-size: 11px !important;
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* 4. 数据单元格与斑马纹统一 */
.spec-table-container td {
  padding: 10px 14px !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
  font-size: 13px !important;
  transition: all 0.15s ease !important;
}

.spec-table-container tbody tr:nth-child(even) td {
  background-color: #f8fafc !important;
}

.spec-table-container tbody tr:hover td {
  background-color: #eff6ff !important;
  color: #1e40af !important;
}

/* 5. 参数名称列 (第一列) 突出显示 */
.spec-table-container tbody tr td:first-child {
  font-weight: 600 !important;
  color: #0f172a !important;
  text-align: left !important;
  background-color: #f8fafc !important;
  border-right: 2px solid #e2e8f0 !important;
}

.spec-table-container tbody tr:hover td:first-child {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* 6. 数字、型号与数值列使用工业等宽字体 */
.spec-table-container td:not(:first-child) {
  font-family: 'JetBrains Mono', 'Roboto Mono', ui-monospace, monospace !important;
}

/* 7. 交互选中激活行高亮 (用于计算器与表格联动) */
.spec-table-container tr.active-spec-row td,
.spec-table-container tr.selected-row td {
  background-color: #dbeafe !important;
  color: #1e3a8a !important;
  font-weight: 700 !important;
  border-top: 2px solid #2563eb !important;
  border-bottom: 2px solid #2563eb !important;
}

.spec-table-container tr.active-spec-row td:first-child,
.spec-table-container tr.selected-row td:first-child {
  border-left: 4px solid #2563eb !important;
  background-color: #bfdbfe !important;
}

/* ==========================================================================
   分类筛选 Tab 按钮激活 / 未激活兜底高对比度样式
   （防止外部样式/CMS按钮重置或Tailwind运行时冲突导致白字无蓝底/白底无边）
   ========================================================================== */
.product-tab-btn,
.dl-type-btn,
.faq-cat-btn {
  background-color: #ffffff !important;
  background-image: none !important;
  color: #334155 !important;
  border-color: #e2e8f0 !important;
  cursor: pointer;
}

.product-tab-btn:hover,
.dl-type-btn:hover,
.faq-cat-btn:hover {
  border-color: #60a5fa !important;
  color: #1d4ed8 !important;
}

.product-tab-btn.is-active,
.product-tab-btn.is-active:hover,
.product-tab-btn[aria-selected="true"],
.product-tab-btn[aria-selected="true"]:hover,
.product-tab-btn.bg-blue-600,
.product-tab-btn.bg-blue-600:hover,
.dl-type-btn.is-active,
.dl-type-btn.is-active:hover,
.dl-type-btn[aria-selected="true"],
.dl-type-btn[aria-selected="true"]:hover,
.dl-type-btn.bg-blue-600,
.dl-type-btn.bg-blue-600:hover,
.faq-cat-btn.is-active,
.faq-cat-btn.is-active:hover,
.faq-cat-btn[aria-selected="true"],
.faq-cat-btn[aria-selected="true"]:hover,
.faq-cat-btn.bg-blue-600,
.faq-cat-btn.bg-blue-600:hover {
  background-color: #2563eb !important;
  background-image: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, 0.38) !important;
}

.product-tab-btn.is-active i,
.product-tab-btn[aria-selected="true"] i,
.product-tab-btn.bg-blue-600 i,
.dl-type-btn.is-active i,
.dl-type-btn[aria-selected="true"] i,
.dl-type-btn.bg-blue-600 i,
.faq-cat-btn.is-active i,
.faq-cat-btn[aria-selected="true"] i,
.faq-cat-btn.bg-blue-600 i {
  color: #ffffff !important;
}

.frame-filter-btn {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  cursor: pointer;
}

.frame-filter-btn:hover {
  background-color: #eff6ff !important;
  color: #2563eb !important;
}

.frame-filter-btn.is-active,
.frame-filter-btn.is-active:hover,
.frame-filter-btn[aria-selected="true"],
.frame-filter-btn[aria-selected="true"]:hover,
.frame-filter-btn.bg-slate-900,
.frame-filter-btn.bg-slate-900:hover {
  background-color: #0f172a !important;
  color: #ffffff !important;
}

.spec-tab-btn {
  background-color: rgba(30, 41, 59, 0.85) !important;
  color: #cbd5e1 !important;
  border-color: #334155 !important;
  cursor: pointer;
}

.spec-tab-btn:hover {
  background-color: #1e293b !important;
  color: #ffffff !important;
}

.spec-tab-btn.is-active,
.spec-tab-btn.is-active:hover,
.spec-tab-btn[aria-selected="true"],
.spec-tab-btn[aria-selected="true"]:hover,
.spec-tab-btn.bg-blue-600,
.spec-tab-btn.bg-blue-600:hover {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

.spec-tab-btn.is-active i,
.spec-tab-btn[aria-selected="true"] i,
.spec-tab-btn.bg-blue-600 i {
  color: #ffffff !important;
}
