/* ====================================================
   响应式导航菜单系统 — nav.css
   支持：PC 横向导航 + 下拉菜单 | 移动端 汉堡菜单 + 折叠面板
   ==================================================== */

/* ---------- CSS 变量 ---------- */
:root {
  --nav-height: 64px;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.98);
  --nav-border: rgba(0, 0, 0, 0.08);
  --nav-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --nav-shadow-scrolled: 0 2px 8px rgba(0,0,0,0.1), 0 8px 32px rgba(0,0,0,0.06);

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --accent: #2563EB;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;

  --dropdown-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 16px 40px -4px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: #f8fafc;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ====================================================
   NAVBAR — 通用结构
   ==================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.navbar.scrolled {
  background: var(--nav-bg-scrolled);
  box-shadow: var(--nav-shadow-scrolled);
  border-bottom-color: transparent;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Logo ---------- */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.8; }
.nav-logo svg { flex-shrink: 0; }

/* ====================================================
   PC 端导航菜单
   ==================================================== */

.nav-menu {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-item {
  position: relative;
}

/* 导航链接通用样式 */
.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  line-height: 1;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
  outline: none;
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* Chevron 箭头 */
.chevron {
  transition: transform 0.25s var(--ease-out);
  flex-shrink: 0;
  color: var(--text-muted);
}

/* -------- 下拉菜单 -------- */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 260px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-lg);
  box-shadow: var(--dropdown-shadow);
  padding: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform 0.25s var(--ease-out);
  z-index: 100;
}

/* 小三角 */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.07);
  border-left: 1px solid rgba(0,0,0,0.07);
}

/* 下拉菜单展开状态 */
.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item.has-dropdown.open .dropdown-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-item.has-dropdown:hover .chevron,
.nav-item.has-dropdown.open .chevron {
  transform: rotate(180deg);
}

.nav-item.has-dropdown:hover .nav-link,
.nav-item.has-dropdown.open .nav-link {
  color: var(--text-primary);
  background: rgba(0,0,0,0.04);
}

/* 下拉菜单项 */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
  color: var(--text-primary);
}

.dropdown-item:hover {
  background: #f3f4f6;
}

.dropdown-item .item-icon {
  font-size: 20px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 8px;
  flex-shrink: 0;
}

.dropdown-item strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.dropdown-item small {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* ---------- 右侧操作区 ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-ghost {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.btn-ghost:hover { color: var(--text-primary); background: rgba(0,0,0,0.04); }

.btn-primary {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}
.btn-primary:active { transform: scale(0.97); }

/* ====================================================
   汉堡按钮（仅移动端可见）
   ==================================================== */

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(0,0,0,0.05); }

.bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s, width 0.3s var(--ease-out);
  transform-origin: center;
}
.bar2 { width: 16px; }

/* 汉堡 → X 动画 */
.hamburger.open .bar1 { transform: translateY(7px) rotate(45deg); width: 22px; }
.hamburger.open .bar2 { opacity: 0; transform: scaleX(0); }
.hamburger.open .bar3 { transform: translateY(-7px) rotate(-45deg); width: 22px; }

/* ====================================================
   移动端遮罩层
   ==================================================== */

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s;
}
.nav-overlay.active {
  opacity: 1;
}

/* ====================================================
   移动端响应式 (≤ 768px)
   ==================================================== */

@media (max-width: 768px) {

  /* 显示汉堡按钮 */
  .hamburger { display: flex; }

  /* 隐藏 PC 操作按钮 */
  .nav-actions { display: none; }

  /* 移动端菜单面板 */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: #fff;
    z-index: 999;
    padding: calc(var(--nav-height) + 16px) 0 32px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease-out);
    box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  }

  .nav-menu.open {
    transform: translateX(0);
  }

  .nav-overlay { display: block; }

  /* 导航列表竖排 */
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0 12px;
  }

  /* 手机端菜单链接 */
  .nav-link {
    width: 100%;
    padding: 13px 16px;
    font-size: 15px;
    border-radius: var(--radius-md);
    justify-content: space-between;
  }

  /* 手机端下拉 — 折叠式展开 */
  .dropdown-menu {
    position: static;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 16px;
    margin: 0;
    opacity: 1;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out), padding 0.3s;
  }

  /* 移除手机端三角 */
  .dropdown-menu::before { display: none; }

  .nav-item.has-dropdown.open .dropdown-menu {
    max-height: 400px;
    pointer-events: auto;
    padding: 4px 0 4px 16px;
  }

  .dropdown-item {
    padding: 10px 12px;
    border-left: 2px solid #f3f4f6;
  }

  .dropdown-item:hover {
    border-left-color: var(--accent);
    background: var(--accent-light);
  }

  /* 移动端底部操作区 */
  .nav-menu::after {
    content: '';
    flex: 1;
  }

  .mobile-footer {
    padding: 16px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    border-top: 1px solid #f3f4f6;
  }
}

/* ====================================================
   平板中间态 (769px ~ 1024px)
   ==================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
  .nav-link { padding: 8px 10px; font-size: 14px; }
  .nav-actions .btn-ghost { display: none; }
}

/* ====================================================
   演示页面样式
   ==================================================== */

main { padding-top: var(--nav-height); }

/* Hero 区域 */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 50%, #f5f0ff 100%);
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.hero-content {
  max-width: 680px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(37,99,235,0.15);
}

.hero h1 {
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 14px 28px !important;
  font-size: 15.5px !important;
  border-radius: var(--radius-md) !important;
}

.btn-outline {
  display: inline-block;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  border: 1.5px solid rgba(37,99,235,0.3);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Section 通用 */
.section {
  padding: 80px 24px;
}

.section-alt {
  background: #fff;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-container h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-container > p {
  color: var(--text-secondary);
  margin-bottom: 48px;
}

/* 卡片网格 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: box-shadow 0.25s, transform 0.25s;
}

.card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-3px);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* 无障碍：焦点可见 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 减弱动效模式 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
