/* 通用响应式设计与单位体系 */
/* Root 字体基准：以 16px 为参考，随视口轻微自适应 */
html {
  /* iOS 避免输入框缩放：最小 1rem=16px */
  font-size: clamp(0.7rem, 0.95rem, 1rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 移动优先：基础排版与触控尺寸 */
:root {
  --touch-size: 3rem; /* ≈48px */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --menu-width: min(75vw, 22rem);
  /* iOS 刘海屏安全区 */
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; }
body { line-height: 1.6; }

img, video, canvas { max-width: 100%; height: auto; }

/* 全局移动端宽度修复：确保内容在小屏占满视口 */
@media (max-width: 48em) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .container, section { width: 100% !important; max-width: 100% !important; }
  /* 常见卡片/面板在移动端扩展到100% */
  .code-window,
  .project-window,
  .dashboard-preview,
  .collab-video-shell,
  .tab-navigation {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* 防止个别图片/视频写死宽度导致左右空白 */
  .container img,
  .container video {
    width: 100% !important;
    height: auto !important;
  }
}

/* 字体大小随视口缩放（示例覆盖常见标题） */
h1 { font-size: clamp(1.75rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
p, li { font-size: clamp(0.95rem, 1.2vw, 1.125rem); }

/* Hero 标题自适应字体（替代写死的 4rem） */
.hero-title {
  font-size: clamp(1.25rem, 5.5vw, 4rem);
  line-height: 1.25;
}

/* 移动端进一步压缩，避免过大 */
@media (max-width: 48em) {
  .hero-title {
    font-size: clamp(1.1rem, 6.5vw, 2.25rem);
  }
}

/* 触控最小目标尺寸（按钮、链接、导航项） */
a, button, .btn, nav a, .tab-btn, .app-btn {
  min-height: var(--touch-size);
  min-width: var(--touch-size);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 表单控件移动端优化 */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="search"], input[type="password"], select, textarea {
  width: 100%;
  height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 1rem;
}

textarea { min-height: 6rem; line-height: 1.6; }

/* 容器与栅格基础（示例） */
.container { padding-left: var(--space-2); padding-right: var(--space-2); }

/* 响应式导航（移动优先） */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-size);
  height: var(--touch-size);
  border: none;
  background: transparent;
  border-radius: 0.75rem;
  cursor: pointer;
  position: relative;
  color: #FFFFFF !important;
}
.hamburger span {
  display: block;
  width: 1.5rem;
  height: 0.125rem;
  background: currentColor;
  border-radius: 0.125rem;
  position: absolute;
  transition: transform 240ms ease, opacity 240ms ease;
}
.hamburger span:nth-child(1) { transform: translateY(-0.4rem); }
.hamburger span:nth-child(2) { transform: translateY(0rem); }
.hamburger span:nth-child(3) { transform: translateY(0.4rem); }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }

/* 移动菜单与遮罩 */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  /* 避免 100vh 在移动端受地址栏影响 */
  height: 100vh; /* fallback */
  height: 100svh; /* iOS 16+ */
  height: 100dvh; /* 现代浏览器 */
  width: var(--menu-width);
  background: rgba(0,0,0,0.92);
  color: #fff;
  z-index: 2600;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.2,.7,.3,1);
  padding: var(--space-3);
  padding-bottom: calc(var(--space-3) + var(--safe-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  -webkit-overflow-scrolling: touch;
  overflow-y: auto; /* 内容超出时可滚动，避免显示不完整 */
}
.mobile-menu nav ul { list-style: none; padding: 0; margin: 0; display: flex !important; flex-direction: column; gap: var(--space-2); }
.mobile-menu nav ul li { display: block !important; width: 100%; }
.mobile-menu nav ul li.mega-parent { display: block !important; width: 100%; }
.mobile-menu nav ul li.mega-parent > a.mega-trigger { display: flex !important; align-items: center; justify-content: space-between; width: 100%; }
.mobile-menu nav a { color: inherit; text-decoration: none; padding: 0.75rem 1rem; border-radius: 0.75rem; display: block; }
.mobile-menu nav a:active { transform: translateY(0.06rem) scale(0.98); }
/* 移动菜单主页 logo 尺寸与展示 */
.mobile-menu .home-link img {
  height: 2rem;
  width: auto;
  border-radius: 0.6rem;
  display: block;
  margin-right: 8px;
  padding: 0.1rem;
  vertical-align: middle;
}
/* 移动菜单容器纵向排列，确保主页项与列表间距 */
.mobile-menu nav { display: flex; flex-direction: column; gap: 0.5rem; }
/* 主页导航项与桌面导航风格对齐（无背景色） */
.mobile-menu nav a.home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.6rem;
  border-radius: 8px; /* 与 index.html 导航倒角统一 */
  background-color: transparent !important; /* 无背景色 */
}
.mobile-menu nav a.home-link:hover { background-color: transparent !important; }

/* 打开态 */
body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
body.nav-open .mobile-menu { transform: translateX(0%); }
body.nav-open { overflow: hidden; overscroll-behavior: contain; }

/* 默认隐藏桌面菜单为移动优先（在大屏再恢复） */
nav ul { display: none; }
.hamburger { display: inline-flex; }

/* 移动端：精简头部，仅保留品牌与菜单按钮（这些规则会被媒体查询覆盖） */
.actions { display: none; }
.brand .home-link { display: none; }

/* 顶部安全区处理（如存在粘性头部） */
header.nav { padding-top: calc(var(--safe-top, 0px)); }

/* 统一断点：1024px */
/* 小于1024px：移动端菜单（折叠） */
@media (max-width: 1023px) {
  /* 隐藏桌面菜单，显示移动菜单按钮 */
  nav ul { display: none !important; }
  .hamburger { display: inline-flex; }
  
  /* 移动端header布局：左边汉堡菜单，中间logo，右边登录按钮 */
  header.nav .nav-inner {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-2);
    height: 55px;
    gap: var(--space-2);
  }
  
  /* 隐藏nav元素在移动端 */
  header.nav .nav-inner nav {
    display: none !important;
  }
  
  /* 汉堡菜单在左边 */
  .hamburger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: var(--touch-size);
    width: var(--touch-size);
    min-width: var(--touch-size);
    min-height: var(--touch-size);
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    order: 1;
  }
  
  /* 显示logo在中间 */
  .brand { 
    display: flex !important; 
    align-items: center;
    justify-content: center;
    flex: 1;
    margin: 0;
    padding: 0;
    order: 2;
    height: 100%;
  }
  .brand .home-link { 
    display: inline-flex !important;
    align-items: center;
    height: auto;
    margin: 0;
  }
  .brand .home-link img {
    height: 2rem;
    width: auto;
    vertical-align: middle;
  }
  
  /* 只显示登录按钮，隐藏其他按钮 */
  .actions { 
    display: flex !important; 
    gap: var(--space-2);
    align-items: center;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    order: 3;
    height: 100%;
  }
  /* 隐藏APP按钮和语言选择器 */
  .actions .btn.primary,
  .actions .language-select,
  .actions .custom-select {
    display: none !important;
  }
  /* 只显示登录按钮 */
  .actions .btn.ghost {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: var(--touch-size);
    margin: 0;
    padding: 0.5rem 1rem;
  }
}

/* 大于等于1024px：桌面菜单 */
@media (min-width: 1024px) {
  /* 显示桌面菜单，隐藏移动菜单按钮 */
  nav ul { display: flex !important; }
  .hamburger { display: none !important; }
  .mobile-menu, .nav-overlay { display: none !important; }
  /* 恢复头部 actions 与主页链接 */
  .actions { display: flex; gap: var(--space-2); align-items: center; }
  .brand .home-link { display: inline-flex; }
  
  /* 桌面端header布局：flex横向排列 */
  header.nav .nav-inner {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
    height: auto;
    gap: var(--space-4);
  }
  
  /* 桌面端brand和nav布局 */
  .brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  
  /* 桌面端nav布局 */
  header.nav .nav-inner nav {
    display: flex !important;
    flex: 1;
    justify-content: center;
    align-items: center;
  }
  
  /* 桌面导航样式 */
  h1 { font-size: clamp(2rem, 3.2vw, 3.25rem); }
  .container { max-width: 85vw; }
  nav ul { gap: clamp(12px, 1.4vw, 18px); }
  nav a { font-size: clamp(0.95rem, 1.1vw, 1.05rem); }
}

@media (min-width: 90em) {
  h1 { font-size: clamp(2.25rem, 2.8vw, 3.5rem); }
  .container { max-width: 90vw; }
}

/* 图片与媒体元素在卡片内的处理 */
.feature-image img, .interface-svg, .code-window, .dashboard-preview, .security-scan-results {
  max-width: 100%;
}

/* 标签和按钮的可触控增强 */
.btn, .app-btn, .tab-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 1rem;
}

/* 移动菜单 - 动作区与语言切换样式 */
.mobile-actions { margin-top: var(--space-3); display: grid; gap: var(--space-2); }
.mobile-actions .btn { width: 100%; justify-content: center; }
.mobile-menu .btn.ghost,
.mobile-actions .btn.ghost {
  color: #fff !important;
  border-color: #fff !important;
}
.mobile-lang { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mobile-lang button { padding: 0.75rem 1rem; border-radius: 0.75rem; border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: #fff; }
.mobile-lang button:active { transform: translateY(0.06rem) scale(0.98); }

/* 面板与卡片的间距（示例） */
.card, .panel, .project-window, .testimonial-card, .feature-content, .feature-image {
  padding: var(--space-2);
}

/* 工具提示：尊重系统减少动效设置 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 小屏（移动设备）隐藏 hero 文案与按钮 */
@media (max-width: 48em) {
  .hero-content h1,
  .hero-content h2,
  .hero-content button,
  .hero-content .btn {
    display: none !important;
  }
}

/* s-cta 双模块布局与样式 */
.s-cta .container {
  padding-left: clamp(16px, 3vw, 28px);
  padding-right: clamp(16px, 3vw, 28px);
}

.cta-grid {
  display: flex;
  flex-direction: column; /* <992px 纵向 */
  gap: 32px;
  align-items: stretch;
}

@media (min-width: 62em) { /* ≥992px 横向 */
  .cta-grid { flex-direction: row; }
}

/* 左：视频播放器 */
.cta-video-player { flex: 1 1 50%; }
.cta-video-header { margin-bottom: 0.5rem; }
.cta-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.cta-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.cta-big-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(44px, 8vw, 72px); height: clamp(44px, 8vw, 72px);
  border-radius: 50%; border: 2px solid rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.2);
  color: #fff; font-size: clamp(18px, 3vw, 28px); line-height: 1;
  display: grid; place-items: center;
  backdrop-filter: blur(4px);
}
.cta-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.05), rgba(0,0,0,0.45));
}
.cta-controls .ctrl-btn {
  background: rgba(255,255,255,0.12);
  color: #fff; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px; padding: 6px 10px;
}
.cta-controls .progress { width: 100%; }
.cta-controls .progress,
.cta-controls .volume { appearance: none; height: 6px; border-radius: 6px; background: rgba(255,255,255,0.3); }
.cta-controls .progress::-webkit-slider-thumb,
.cta-controls .volume::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 1px solid #888; }

/* 右：轮播 */
.cta-carousel { flex: 1 1 50%; display: flex; flex-direction: column; gap: 12px; }
/* coverflow 视图：透明背景与分层效果 */
.carousel-viewport { position: relative; width: 100%; overflow: hidden; aspect-ratio: 16 / 9; background: transparent; }
.carousel-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: none; background: rgba(0,0,0,0.35); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(4px); transition: background 200ms ease, transform 200ms ease; }
.carousel-nav:hover { background: rgba(0,0,0,0.5); transform: translateY(-50%) scale(1.05); }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }
.carousel-track { position: relative; width: 100%; height: 100%; will-change: transform; }
.carousel-card { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(88%, 420px); height: 100%; border-radius: 12px; overflow: hidden; background: transparent; border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 18px 40px rgba(0,0,0,0.35); transition: transform 450ms cubic-bezier(.2,.7,.3,1), box-shadow 350ms ease, opacity 350ms ease; }
.carousel-card:hover { box-shadow: 0 24px 56px rgba(0,0,0,0.45); }
.carousel-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.carousel-card.is-active { z-index: 40; box-shadow: 0 28px 64px rgba(0,0,0,0.5); }
.carousel-card.is-far { opacity: 0.82; }
.card-content { padding: 12px 14px; }
.card-title { font-weight: 700; margin-bottom: 6px; }
.card-desc { color: var(--muted); font-size: 0.95rem; }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.35); border: none; transition: transform 220ms ease, background 220ms ease; }
.carousel-dots button.active { background: #fff; transform: scale(1.4); }

@media (min-width: 62em) {
  .carousel-card { width: min(84%, 440px); }
}

@media (min-width: 90em) {
  .carousel-card { width: min(80%, 480px); }
}

/* s-cta：大屏严格左右各占一半 */
@media (min-width: 62em) {
  .s-cta .cta-grid { align-items: stretch; }
  .s-cta .cta-video-player, .s-cta .cta-carousel { flex: 0 0 50%; max-width: 50%; min-width: 0; }
}

/* s-cta：当轮播设置为全屏时（替换原视频位置） */
.s-cta .cta-carousel.fullwidth {
  flex: 1 1 100%;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100vw;
}
.s-cta .cta-carousel.fullwidth .carousel-header { text-align: center; padding: 0 clamp(16px, 4vw, 40px); }
.s-cta .cta-carousel.fullwidth .carousel-viewport { max-width: 100vw; }

/* 活动场景区域视频占满容器 */
.photo-top video { width: 100%; height: auto; display: block; border-radius: 12px; }

/* main_video_002_001 模块的响应式适配 */
.main_video_002_001 {
  width: 100%;
  margin: 0 auto;
}

.main_video_002_001 > div {
  gap: clamp(12px, 2vw, 24px);
}

/* 平板及以下：收紧左右两列宽度，避免拥挤与溢出 */
@media (max-width: 64em) {
  /* 左侧文案列（第一个子 div） */
  .main_video_002_001 > div > div:first-child {
    width: 60vw !important;
    margin-left: 0 !important;
  }
  /* 右侧图片列 */
  .main_video_002_001 .collab-video-shell { 
    margin: clamp(12px, 2.5vw, 24px) !important; 
  }
  .main_video_002_001 .collab-video-shell img {
    width: 50vw !important;
    height: auto;
  }
}

/* 移动端：改为上下布局，并让媒体元素自适应容器宽度 */
@media (max-width: 48em) {
  .main_video_002_001 {
    padding: 0 var(--space-2);
  }
  .main_video_002_001 > div {
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .main_video_002_001 > div > div:first-child {
    width: 100% !important;
    margin-left: 0 !important;
    padding: var(--space-2) !important;
  }
  .main_video_002_001 .collab-video-shell {
    width: 100%;
    margin: var(--space-2) 0 !important;
  }
  .main_video_002_001 .collab-video-shell img {
    width: 100% !important;
    height: auto;
  }
}
/* Overrides: carousel width to 80vw and card image contain */
.s-cta .cta-carousel.fullwidth { width: 80vw !important; max-width: 80vw !important; }
.s-cta .cta-carousel.fullwidth .carousel-viewport { max-width: 80vw !important; }
.carousel-card img { object-fit: contain !important; }
/* Global i18n visibility rules: ensure data-lang spans show/hide for zh-CN/en-US */
[data-lang="zh"] { display: inline !important; }
[data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="en"],
html[lang^="en"] [data-lang="en"] { display: inline !important; }
html[lang="en"] [data-lang="zh"],
html[lang^="en"] [data-lang="zh"] { display: none !important; }
html[lang="zh"] [data-lang="zh"],
html[lang^="zh"] [data-lang="zh"] { display: inline !important; }
html[lang="zh"] [data-lang="en"],
html[lang^="zh"] [data-lang="en"] { display: none !important; }

/* =====================
   Megadropdown: 学习软件系统矩阵
   ===================== */
/* 确保header和nav容器不会裁剪下拉菜单 */
header.nav,
header.nav .nav-inner,
header.nav nav,
header.nav nav ul {
  overflow: visible !important;
}

/* 父级菜单项定位与触发 */
nav ul li.mega-parent { 
  position: relative; 
  overflow: visible;
}
nav ul li.mega-parent > a.mega-trigger { 
  position: relative; 
  z-index: 1; 
}

/* 面板容器：现代简约风格，默认隐藏，悬停显示 */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  /* 尺寸：宽度适中，自适应高度 */
  width: 600px;
  max-width: calc(100vw - 48px);
  height: auto;
  min-height: 280px;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .15s ease-in-out, transform .15s ease-in-out, visibility .15s ease-in-out;
  z-index: 3000;
}
/* 在下拉面板上方创建一个不可见的桥接区域，方便鼠标移入 */
.mega-dropdown::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: -20px;
  right: -20px;
  height: 10px;
  background: transparent;
  pointer-events: auto;
  z-index: 2999;
}
/* 修复无法移入的问题：面板自身悬停或菜单获得焦点都保持展开 */
nav ul li.mega-parent:hover .mega-dropdown,
nav ul li.mega-parent:focus-within .mega-dropdown,
nav ul li.mega-parent .mega-dropdown:hover {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}
/* 桥接区域也触发显示 */
nav ul li.mega-parent:hover .mega-dropdown::before,
nav ul li.mega-parent .mega-dropdown:hover::before {
  pointer-events: auto !important;
}
/* 点击触发：当父级带有 .open 时保持展开 */
nav ul li.mega-parent.open .mega-dropdown {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}
/* 下拉面板内容区域始终可交互 */
.mega-dropdown > * {
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

/* 内部分栏：左右各占 50% 宽度，现代简约布局 */
.mega-inner {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 左右各占 50% 宽度 */
  align-items: start; /* 顶端对齐，避免高度错位 */
  width: 100%;
  height: auto;
  min-height: 300px;
  gap: 0; /* 无间距，统一白色背景 */
  overflow: hidden;
  background: #FFFFFF;
  border-radius: 8px;
}
.mega-left { 
  background: transparent; 
  padding: 32px 36px; 
  display: flex; 
  flex-direction: column; 
  gap: 20px; 
}
.mega-right { 
  background: transparent; 
  padding: 32px 36px; 
  border-left: none; /* 移除分隔线 */
}
/* 过渡以便滚动状态切换更平滑 */
.mega-dropdown, .mega-left, .mega-right, .mega-section-title { 
  transition: color .2s ease; 
}

/* 防止 nav ul 的全局 flex 影响下拉内部列表 */
.mega-dropdown ul { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
  display: block !important; 
}

/* 区域标题样式 - 现代简约风格，强制黑色文字 */
.mega-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #6B7280 !important; /* 浅灰色，更低调，强制覆盖 */
  margin: 0 0 20px;
  line-height: 1.4;
}
.mega-section-title span {
  color: #6B7280 !important; /* 确保span也是灰色 */
}

/* 图标样式，强制深色 */
.mega-icon {
  flex-shrink: 0;
  color: #1F2937 !important; /* 深色图标，强制覆盖 */
  transition: color .2s ease;
}

/* 链接内容容器 */
.mega-link-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 左侧主链接样式 - 现代简约，无边框无背景，强制黑色文字 */
.mega-main-link { 
  text-decoration: none; 
  display: flex; 
  align-items: flex-start;
  gap: 16px;
  padding: 0; 
  background: transparent !important; /* 无背景，强制覆盖 */
  border: none !important; /* 无边框，强制覆盖 */
  color: #000000 !important; /* 强制黑色文字 */
  transition: opacity .2s ease; 
}
.mega-main-link * {
  color: inherit; /* 继承父元素颜色 */
}
.mega-main-link .mega-title {
  font-size: 16px;
  font-weight: 600;
  color: #000000 !important; /* 纯黑色，主标题，强制覆盖 */
  margin: 0;
  line-height: 1.4;
}
.mega-main-link .mega-title span {
  color: #000000 !important; /* 确保span也是黑色 */
}
.mega-main-link .mega-subtitle { 
  font-size: 14px; 
  font-weight: 400;
  color: #4B5563 !important; /* 中等灰色，副标题，强制覆盖 */
  line-height: 1.5;
  margin: 0;
}
.mega-main-link .mega-subtitle span {
  color: #4B5563 !important; /* 确保span也是灰色 */
}
.mega-main-link:hover { 
  opacity: 0.8; /* 悬停时轻微透明度变化 */
  color: #000000 !important; /* 悬停时保持黑色 */
}
.mega-main-link:hover .mega-title,
.mega-main-link:hover .mega-title span {
  color: #000000 !important;
}
.mega-main-link:hover .mega-icon {
  color: #111827 !important;
}

/* 右侧链接列表样式 - 现代简约，无边框无背景，强制黑色文字 */
.mega-right-list { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
  display: flex !important; /* 使用 flex 布局 */
  flex-direction: column; /* 垂直排列 */
  gap: 20px; 
  align-items: stretch;
}
.mega-right-list li { 
  display: block; 
  width: 100%; 
  min-width: 0;
}
.mega-right-list a { 
  display: flex; 
  align-items: flex-start;
  gap: 12px;
  padding: 0; 
  color: #000000 !important; /* 强制黑色文字 */
  background-color: transparent !important; /* 无背景，强制覆盖 */
  border: none !important; /* 无边框，强制覆盖 */
  text-decoration: none; 
  transition: opacity .2s ease; 
  width: 100%;
}
/* 确保右侧链接的所有文字元素都是黑色，不被继承规则影响 */
.mega-right-list a,
.mega-right-list a *,
.mega-right-list a span,
.mega-right-list a div,
.mega-right-list a div *,
.mega-right-list a div span {
  color: #000000 !important; /* 强制所有文字为黑色 */
}
.mega-right-list a .mega-link-content {
  flex: 1;
}
.mega-right-list a .mega-title {
  font-size: 14px;
  font-weight: 600;
  color: #000000 !important; /* 纯黑色，主标题，强制覆盖 */
  margin: 0 0 2px 0;
  line-height: 1.4;
}
.mega-right-list a .mega-title,
.mega-right-list a .mega-title *,
.mega-right-list a .mega-title span,
.mega-right-list a .mega-title div {
  color: #000000 !important; /* 确保标题及其所有子元素都是黑色 */
}
.mega-right-list a .mega-subtitle {
  font-size: 13px;
  font-weight: 400;
  color: #6B7280 !important; /* 浅灰色，副标题，强制覆盖 */
  line-height: 1.5;
  margin: 0;
}
.mega-right-list a .mega-subtitle,
.mega-right-list a .mega-subtitle *,
.mega-right-list a .mega-subtitle span,
.mega-right-list a .mega-subtitle div {
  color: #6B7280 !important; /* 确保副标题及其所有子元素都是灰色 */
}
.mega-right-list a:hover { 
  opacity: 0.7; /* 悬停时轻微透明度变化 */
  color: #000000 !important; /* 悬停时保持黑色 */
}
.mega-right-list a:hover .mega-title,
.mega-right-list a:hover .mega-title span {
  color: #000000 !important;
}
.mega-right-list a:hover .mega-icon {
  color: #111827 !important;
}
.mega-right-list a:focus-visible { 
  outline: 2px solid #3498DB; 
  outline-offset: 4px; 
  border-radius: 4px;
}

/* 语言自动切换：根据 html[lang] 控制显隐 */
.mega-title [data-lang],
.mega-subtitle [data-lang],
.mega-section-title [data-lang] { display: none; }
html[lang="zh-CN"] .mega-title [data-lang="zh"],
html[lang="zh-CN"] .mega-subtitle [data-lang="zh"],
html[lang="zh-CN"] .mega-section-title [data-lang="zh"] { display: inline; }
html[lang="en"] .mega-title [data-lang="en"],
html[lang="en"] .mega-subtitle [data-lang="en"],
html[lang="en"] .mega-section-title [data-lang="en"] { display: inline; }

/* 大于等于1024px：桌面菜单，二级菜单动态定位 */
@media (min-width: 1024px) {
  /* 确保header和nav容器不会裁剪下拉菜单 */
  header.nav,
  header.nav .nav-inner,
  header.nav nav,
  header.nav nav ul {
    overflow: visible !important;
  }
  
  /* 二级菜单悬停显示 */
  nav ul li.mega-parent:hover .mega-dropdown,
  nav ul li.mega-parent:focus-within .mega-dropdown,
  nav ul li.mega-parent .mega-dropdown:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
}

/* 小于1024px：移动端菜单，二级菜单在移动菜单中展开 */
@media (max-width: 1023px) {
  /* 桌面菜单中的二级菜单隐藏 */
  nav ul li.mega-parent .mega-dropdown { 
    display: none !important; 
  }
  
  /* 移动菜单中的二级菜单展开样式 */
  .mobile-menu nav ul li.mega-parent .mega-dropdown { 
    display: none !important; 
  }
  
  .mobile-menu nav ul li.mega-parent.open .mega-dropdown {
    display: block !important;
    position: static;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #FFFFFF !important;
    padding: 20px 16px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    z-index: auto;
  }
  .mega-inner { 
    display: block; 
    min-height: 0; 
    grid-template-columns: 1fr;
  }
  .mega-left, .mega-right { 
    background: transparent; 
    padding: 0; 
    border: none; 
  }
  .mega-right { 
    border-left: none; 
    margin-top: 24px;
  }

  /* 移动端排版与可读性优化：现代简约风格，无边框无背景，强制黑色文字 */
  nav ul li.mega-parent.open .mega-section-title,
  nav ul li.mega-parent.open .mega-section-title span {
    color: #6B7280 !important; /* 浅灰色标题，强制覆盖 */
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1.4;
    margin-bottom: 16px;
  }
  nav ul li.mega-parent.open .mega-main-link {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    gap: 12px;
    color: #000000 !important; /* 强制黑色文字 */
  }
  nav ul li.mega-parent.open .mega-main-link .mega-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #1F2937 !important; /* 强制深色图标 */
  }
  nav ul li.mega-parent.open .mega-main-link .mega-title,
  nav ul li.mega-parent.open .mega-main-link .mega-title span {
    color: #000000 !important; /* 纯黑色，强制覆盖 */
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
  }
  nav ul li.mega-parent.open .mega-main-link .mega-subtitle,
  nav ul li.mega-parent.open .mega-main-link .mega-subtitle span {
    color: #4B5563 !important; /* 中等灰色，强制覆盖 */
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
  }
  nav ul li.mega-parent.open .mega-right-list {
    gap: 16px; /* 缩小间距 */
  }
  nav ul li.mega-parent.open .mega-right-list a {
    background: transparent !important;
    border: none !important;
    color: #000000 !important; /* 纯黑色，强制覆盖 */
    padding: 0;
    min-height: auto;
    gap: 12px;
  }
  nav ul li.mega-parent.open .mega-right-list a .mega-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #1F2937 !important; /* 强制深色图标 */
  }
  nav ul li.mega-parent.open .mega-right-list a .mega-title,
  nav ul li.mega-parent.open .mega-right-list a .mega-title span {
    color: #000000 !important; /* 强制黑色 */
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 2px 0;
  }
  nav ul li.mega-parent.open .mega-right-list a .mega-subtitle,
  nav ul li.mega-parent.open .mega-right-list a .mega-subtitle span {
    color: #6B7280 !important; /* 浅灰色，强制覆盖 */
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    white-space: normal;
    word-break: break-word;
  }
  nav ul li.mega-parent.open .mega-right-list a:hover {
    background-color: transparent !important;
    color: #000000 !important; /* 悬停时保持黑色 */
    text-decoration: none;
    opacity: 0.7;
    transform: none;
  }
  nav ul li.mega-parent.open .mega-right-list a:hover .mega-title,
  nav ul li.mega-parent.open .mega-right-list a:hover .mega-title span {
    color: #000000 !important;
  }
  /* 展开时为下拉内容与主菜单留出间距 */
  nav ul li.mega-parent.open .mega-dropdown { margin-top: 8px !important; }

  /* 展开时让头部导航高度自适应（避免被固定 55px 高度裁剪） */
  header.nav.nav-open { height: auto !important; }
  header.nav.nav-open .nav-inner { height: auto !important; align-items: flex-start; }
}

/* 平板及较窄桌面：右侧链接单列显示，保证整齐 */
@media (max-width: 75em) { /* <= 1200px */
  .mega-right-list { grid-template-columns: 1fr; }
}

/* 滚动后（header.nav.scrolled）下拉面板统一保持白色背景和现代简约风格，强制黑色文字 */
header.nav.scrolled .mega-dropdown { 
  background: #FFFFFF !important; 
  border-color: rgba(0, 0, 0, 0.06) !important; 
}

header.nav.scrolled .mega-left { 
  background: transparent !important; 
}
header.nav.scrolled .mega-right { 
  background: transparent !important; 
  border-left: none !important; 
}
header.nav.scrolled .mega-section-title,
header.nav.scrolled .mega-section-title span { 
  color: #6B7280 !important; /* 保持浅灰色，强制覆盖 */
}
header.nav.scrolled .mega-main-link { 
  background: transparent !important; 
  border: none !important; 
  box-shadow: none !important; 
  color: #000000 !important; /* 强制黑色文字 */
}
header.nav.scrolled .mega-main-link .mega-title,
header.nav.scrolled .mega-main-link .mega-title span { 
  color: #000000 !important; /* 纯黑色，强制覆盖 */
}
header.nav.scrolled .mega-main-link .mega-subtitle,
header.nav.scrolled .mega-main-link .mega-subtitle span { 
  color: #4B5563 !important; /* 中等灰色，强制覆盖 */
}
header.nav.scrolled .mega-main-link:hover { 
  background-color: transparent !important; 
  border: none !important; 
  box-shadow: none !important; 
  opacity: 0.8 !important;
  color: #000000 !important; /* 悬停时保持黑色 */
}
header.nav.scrolled .mega-main-link:hover .mega-title,
header.nav.scrolled .mega-main-link:hover .mega-title span { 
  color: #000000 !important; /* 悬停时保持黑色 */
}
header.nav.scrolled .mega-icon {
  color: #1F2937 !important; /* 强制深色图标 */
}
header.nav.scrolled .mega-right-list a { 
  background-color: transparent !important; 
  color: #000000 !important; /* 强制黑色文字 */
  border: none !important; 
}
/* 滚动后确保右侧链接的所有文字元素都是黑色 */
header.nav.scrolled .mega-right-list a,
header.nav.scrolled .mega-right-list a *,
header.nav.scrolled .mega-right-list a span,
header.nav.scrolled .mega-right-list a div,
header.nav.scrolled .mega-right-list a div *,
header.nav.scrolled .mega-right-list a div span {
  color: #000000 !important; /* 强制所有文字为黑色 */
}
header.nav.scrolled .mega-right-list a .mega-title,
header.nav.scrolled .mega-right-list a .mega-title *,
header.nav.scrolled .mega-right-list a .mega-title span,
header.nav.scrolled .mega-right-list a .mega-title div {
  color: #000000 !important; /* 纯黑色，强制覆盖 */
}
header.nav.scrolled .mega-right-list a .mega-subtitle,
header.nav.scrolled .mega-right-list a .mega-subtitle *,
header.nav.scrolled .mega-right-list a .mega-subtitle span,
header.nav.scrolled .mega-right-list a .mega-subtitle div {
  color: #6B7280 !important; /* 浅灰色，强制覆盖 */
}
header.nav.scrolled .mega-right-list a:hover { 
  background-color: transparent !important; 
  color: #000000 !important; /* 悬停时保持黑色 */
  border: none !important; 
  box-shadow: none !important; 
  text-decoration: none !important; 
  opacity: 0.7 !important;
  transform: none !important;
}
header.nav.scrolled .mega-right-list a:hover .mega-title,
header.nav.scrolled .mega-right-list a:hover .mega-title span {
  color: #000000 !important; /* 悬停时保持黑色 */
}
header.nav.scrolled .mega-right-list a:hover .mega-icon {
  color: #111827 !important; /* 悬停时图标颜色 */
}