/**
 * ============================================================================
 * CatuxXS 布局样式 - 导航 + 进度指示器 + 页面区块基础
 * ============================================================================
 * 
 * 文件名：layout.css
 * 描述：固定导航栏、汉堡菜单、进度指示器、全屏滚动页面区块基础样式
 * 依赖：variables.css（需先加载）
 * 创建日期：2026-04-08
 * 
 * ============================================================================
 */

/* ========================================
   5. 布局组件（Layout）
   ======================================== */

/* ==================== 导航栏 ==================== */

/**
 * 固定导航栏
 */
.nav {
  position: fixed;                     /* 固定定位 */
  top: 0;                              /* 顶部 */
  left: 0;                             /* 左侧 */
  right: 0;                            /* 右侧 */
  height: 72px;                        /* 高度 */
  background: rgba(255,255,255,0.95);  /* 半透明背景 */
  backdrop-filter: blur(10px);          /* 背景模糊 */
  border-bottom: 1px solid var(--gray-200);  /* 底部边框 */
  z-index: 1000;                       /* 层级 */
  display: flex;                       /* 弹性盒 */
  align-items: center;                 /* 垂直居中 */
  justify-content: space-between;      /* 两端对齐 */
  padding: 0 24px;                     /* 内边距 */
}

/**
 * 导航栏Logo
 */
.nav-logo {
  display: flex;                       /* 弹性盒 */
  align-items: center;                 /* 垂直居中 */
  gap: 10px;                           /* 间距 */
  font-size: 1.25rem;                  /* 字号 */
  font-weight: 700;                     /* 字重 */
  text-decoration: none;               /* 移除下划线 */
  color: var(--gray-900);               /* 文字色 */
}

/**
 * Logo图标（文字版备用）
 */
.nav-logo-icon {
  width: 36px;                         /* 宽度 */
  height: 36px;                        /* 高度 */
  background: linear-gradient(135deg, var(--primary-500), var(--primary-900));  /* 渐变背景 */
  border-radius: 8px;                  /* 圆角 */
  display: flex;                       /* 弹性盒 */
  align-items: center;                /* 垂直居中 */
  justify-content: center;             /* 水平居中 */
  color: white;                        /* 图标色 */
  font-weight: 700;                    /* 字重 */
}

/**
 * 导航链接列表
 */
.nav-links {
  display: none;                       /* 移动端默认隐藏 */
  list-style: none;                    /* 移除列表样式 */
  margin: 0;
  padding: 0;
}

/* 移动端：打开时显示为全屏菜单 */
.nav-links.show {
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  height: calc(100vh - 72px);
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 40px;
  gap: 4px;
  z-index: 999;
  overflow-y: auto;
  animation: mobileMenuSlideIn 0.3s ease-out;
}

@keyframes mobileMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-links.show .nav-link {
  width: 100%;
  max-width: 360px;
  padding: 14px 20px;
  font-size: 1.0625rem;
  text-align: center;
  border-radius: 12px;
}

/* 桌面端显示导航链接 */
@media (min-width: 1024px) {
  .nav-links {
    display: flex;                      /* 显示导航 */
    justify-content: center;             /* 水平居中 */
    align-items: center;                 /* 垂直居中 */
    gap: 4px;                            /* 间距缩小 */
    position: static;
    width: auto;
    height: auto;
    background: none;
    backdrop-filter: none;
    padding: 0;
    overflow: visible;
    animation: none;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .nav-links .nav-link {
    width: auto;
    max-width: none;
    padding: 6px 10px;
    font-size: 0.8125rem;
    border-radius: 8px;
  }
}

/**
 * 导航链接
 */
.nav-link {
  padding: 8px 16px;                   /* 内边距 */
  font-size: 0.9375rem;                /* 字号 */
  font-weight: 500;                    /* 字重 */
  color: var(--gray-600);              /* 文字色 */
  text-decoration: none;               /* 移除下划线 */
  border-radius: 8px;                  /* 圆角 */
  transition: all var(--transition-fast);  /* 过渡效果 */
  background: none;                    /* 背景透明 */
  border: none;                        /* 无边框 */
  cursor: pointer;                    /* 鼠标指针 */
  font-family: inherit;                /* 继承字体 */
  white-space: nowrap;                 /* 禁止文字换行 */
}

.nav-link:hover {
  color: var(--gray-900);              /* 悬停颜色 */
  background: var(--gray-100);          /* 悬停背景 */
}

.nav-link.active {
  color: var(--primary-600);          /* 激活颜色 */
  background: var(--primary-50);      /* 激活背景 */
}

/**
 * 汉堡菜单按钮
 * 移动端显示，桌面端隐藏
 */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  z-index: 1001;
}

.hamburger-btn:hover {
  background: var(--gray-100);
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* 汉堡菜单打开时的动画（X形） */
.hamburger-btn.open .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.hamburger-btn.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-btn.open .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* 移动端遮罩层 */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.show {
  display: block;
  opacity: 1;
}

/* 桌面端隐藏汉堡按钮 */
@media (min-width: 1024px) {
  .hamburger-btn {
    display: none;
  }
}

/* ==================== 进度指示器 ==================== */

/**
 * 进度指示器
 * 固定在页面右侧
 */
.progress-indicator {
  position: fixed;                     /* 固定定位 */
  right: 20px;                         /* 右侧 */
  top: 50%;                            /* 垂直居中 */
  transform: translateY(-50%);         /* 垂直偏移 */
  display: flex;                       /* 弹性盒 */
  flex-direction: column;              /* 纵向排列 */
  gap: 12px;                           /* 间距 */
  z-index: 1000;                       /* 层级 */
}

/**
 * 进度点
 */
.progress-dot {
  width: 10px;                         /* 宽度 */
  height: 10px;                        /* 高度 */
  border-radius: 50%;                  /* 圆形 */
  background: var(--gray-300);          /* 背景色 */
  cursor: pointer;                     /* 鼠标指针 */
  transition: all var(--transition-normal);  /* 过渡效果 */
}

.progress-dot.active {
  background: var(--primary-500);      /* 激活颜色 */
  transform: scale(1.3);               /* 放大 */
}

.progress-dot:hover {
  background: var(--primary-400);     /* 悬停颜色 */
}

/* 移动端隐藏进度指示器 */
@media (max-width: 768px) {
  .progress-indicator {
    display: none;                      /* 隐藏 */
  }
}

/* iPad 横屏优化 (768px - 1024px) — 设备优势标签页 */
@media (min-width: 768px) and (max-width: 1024px) {
  .advantages-tabs-nav {
    gap: 12px;
    margin-bottom: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, var(--primary-50) 80%, transparent);
    padding: 16px 0;
  }

  .tab-btn {
    padding: 14px 6px;
    border-radius: 12px;
  }

  .tab-icon {
    font-size: 1.5rem;
  }

  .tab-title {
    font-size: 0.8125rem;
    font-weight: 700;
  }

  .tab-subtitle {
    font-size: 0.6875rem;
    display: none;
  }

  .tab-panel {
    padding: 32px;
    padding-top: 16px;
  }

  .advantage-detail-header {
    scroll-margin-top: 100px;
  }

  .comparison-table-header,
  .comparison-table-row {
    grid-template-columns: 0.8fr 1fr 1fr;
  }

  .table-cell {
    padding: 12px 14px;
    font-size: 0.8125rem;
  }

  .advantage-detail-header {
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
  }

  .detail-icon-large {
    width: 72px;
    height: 72px;
  }

  .detail-icon-large svg {
    width: 36px;
    height: 36px;
  }

  .detail-title-group h3 {
    font-size: 1.375rem;
  }

  .detail-subtitle {
    font-size: 0.875rem;
  }

  .advantage-point {
    padding: 16px;
    gap: 12px;
  }

  .point-content h4 {
    font-size: 1rem;
  }

  .point-content p {
    font-size: 0.875rem;
  }

  .tab-panel-footer {
    padding: 24px 0;
    margin-top: 24px;
  }

  .tab-nav-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
  }
}

/* ==================== 页面区块 ==================== */

/**
 * 全屏滚动区块
 * 每个区块占满一屏
 */
.section {
  min-height: 100vh;                  /* 最小高度100vh */
  scroll-snap-align: start;           /* 滚动吸附 */
  scroll-snap-stop: always;           /* 吸附停止 */
  padding: 80px 24px;                 /* 内边距 */
  display: flex;                       /* 弹性盒 */
  flex-direction: column;             /* 纵向排列 */
  justify-content: center;             /* 垂直居中 */
  position: relative;                  /* 相对定位 */
}

/**
 * 交替区块背景
 */
.section-alt {
  background: white;                   /* 白色背景 */
}

.section-alt .section-title {
  color: var(--gray-900);
}

.section-alt .section-desc {
  color: var(--gray-500);
}

.section-alt .section-label {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary-500);
}

/* 移动端区块样式调整 */
@media (max-width: 768px) {
  .section {
    padding: 60px 16px 80px;          /* 调整内边距 */
  }
}
