:root {
  --primary: #181e25; /* 主色 */
  --text-dark: #181e25;
  --text-secondary: #666;
  --text-light: #aab1ba;
  --bg-light: #f7f8fa;
  --border: #dee2e9;
  --white: #ffffff;
  --shadow-soft: 0 18px 45px rgba(17, 24, 39, 0.08);
  --shadow-lift: 0 28px 80px rgba(17, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--white);
}

/* ===== 白底不变的“科技感材质”增强（轻网格 + 光晕） ===== */
.home-page {
  position: relative;
}

/* 仅对非 Hero 的 section 做轻微“科技纸张”纹理（不改变配色，只增加层次） */
.home-page .page-section:not(.section-hero) {
  background-image: radial-gradient(
      820px 460px at 14% 0%,
      rgba(24, 30, 37, 0.05),
      transparent 62%
    ),
    radial-gradient(
      760px 420px at 86% 18%,
      rgba(24, 30, 37, 0.04),
      transparent 60%
    );
  background-repeat: no-repeat;
}

.home-page .page-section:nth-of-type(even):not(.section-hero) {
  background-image: radial-gradient(
      760px 440px at 18% 12%,
      rgba(24, 30, 37, 0.05),
      transparent 62%
    ),
    radial-gradient(
      900px 520px at 86% 0%,
      rgba(24, 30, 37, 0.04),
      transparent 62%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(24, 30, 37, 0.025) 0 1px,
      transparent 1px 44px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(24, 30, 37, 0.02) 0 1px,
      transparent 1px 44px
    );
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}

/* =============================
   Home Page: 分区背景 + 滚动交互
   ============================= */
.home-page .page-section {
  position: relative;
  overflow: hidden;
  padding: 0;
  scroll-margin-top: 90px; /* 顶部 navbar 为 78px，额外留 12px 视觉间距 */
  background: var(--white);
}

/* 两种背景交替，让用户更明确感知分区切换 */
.home-page .page-section:nth-of-type(even) {
  background: var(--bg-light);
}

/* 分区之间的轻分隔：只靠背景切换时依然能感知边界 */
.home-page .page-section + .page-section {
  border-top: 1px solid rgba(24, 30, 37, 0.04);
}

/* 让每段的 content-section 变成“全宽背景中的居中容器” */
.home-page .page-section > .content-section {
  margin: 0 auto;
  padding-top: 88px;
  padding-bottom: 88px;
}

/* 除第一个 section（Hero）外，其它 section 上下 padding 统一为 30px */
.home-page .page-section:not(.section-hero) > .content-section {
  padding-top: 40px;
  padding-bottom: 40px;
}

/* 右侧 ScrollSpy 导航：让用户知道“到达下一个区域” */
.section-nav {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
}

.section-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(24, 30, 37, 0.12);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.1);
}

.section-nav-item {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(24, 30, 37, 0.62);
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.section-nav-item:hover {
  background: rgba(24, 30, 37, 0.05);
  border-color: rgba(24, 30, 37, 0.12);
  color: rgba(24, 30, 37, 0.82);
}

.section-nav-item.is-active {
  background: linear-gradient(
    90deg,
    rgba(124, 92, 255, 0.14),
    rgba(47, 140, 255, 0.1)
  );
  border-color: rgba(124, 92, 255, 0.22);
  color: var(--text-dark);
}

.section-nav-label {
  font-size: 13px;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .section-nav {
    display: none;
  }
}

/* Hero 距离 header 更紧：目标是 header 下方 20px */
.home-page .section-hero > .content-section {
  padding-top: 20px;
  padding-bottom: 40px;
}

/* 图片/图表统一做成“媒体卡片” */
.home-page .media-wrap {
  margin-top: 22px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.home-page .media-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* 滚动进入视口的 reveal 动画（仅用于媒体，正文不做任何模糊/渐隐） */
.home-page [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
  will-change: opacity, transform;
}

.home-page [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .home-page [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 顶部导航 */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  height: 78px;
}

.nav-container {
  max-width: 1920px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 60px;
}

/* React 版本中 Logo 外层是一个 <a>（Link），需要它来撑开把导航推到右侧 */
.nav-container > a {
  margin-right: auto;
  display: flex;
  align-items: center;
}

.logo {
  height: 75px;
  margin-right: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 16px;
  font-weight: 400;
  border-radius: 32px;
  transition: all 0.3s ease;
}

.nav-links a:hover {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.nav-lang-toggle {
  padding: 8px 14px;
  border-radius: 32px;
  border: 1px solid rgba(24, 30, 37, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    transform 0.12s ease;
}

.nav-lang-toggle:hover {
  background: var(--bg-light);
  border-color: rgba(24, 30, 37, 0.18);
}

.nav-lang-toggle:active {
  transform: translateY(1px);
}

/* 主视觉区 */
.hero {
  padding: 0;
  text-align: center;
  background: var(--white);
  color: var(--text-dark);
  margin-top: 78px;
}

.hero h1 {
  font-size: 54px;
  font-weight: 500;
  line-height: 86.4px;
  margin: 0 0 36px 0;
  color: var(--text-dark);
}

.hero .subtitle {
  font-size: 18px;
  font-weight: 300;
  line-height: 28.8px;
  margin: 0 auto 40px;
  max-width: 800px;
  color: var(--text-dark);
  opacity: 0.8;
}

/* 英文文案更长：在常规屏幕下尽量保持副标题单行展示，避免“中途换行”破坏版式 */
html[lang="en"] .hero .subtitle {
  white-space: nowrap;
  font-size: 16px;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

/* 小屏兜底：避免强制不换行导致溢出 */
@media (max-width: 520px) {
  html[lang="en"] .hero .subtitle {
    white-space: normal;
  }
}

/* Hero 副标题：把模型规格做成 chips，信息更清晰 */
.hero .subtitle .subtitle-lead {
  font-weight: 400;
}

.hero .subtitle .subtitle-models {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  vertical-align: middle;
  margin-left: 6px;
}

.hero .subtitle .subtitle-chip {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(24, 30, 37, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: rgba(24, 30, 37, 0.92);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* Hero 内：副标题距离上方图片固定 10px */
.section-hero .subtitle {
  margin-top: 10px;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}

.btn-icon {
  margin-left: 8px;
  flex: 0 0 auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  /* 白底不变：用轻微高光让按钮更现代 */
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0) 58%
    ),
    var(--primary);
  color: var(--white);
  box-shadow: 0 14px 32px rgba(24, 30, 37, 0.18);
}

.btn-primary:hover {
  box-shadow: 0 18px 44px rgba(24, 30, 37, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-dark);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
}

.simple-page-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
}

.hero-image {
  width: 100%;
  margin: 16px auto 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  background: var(--white);
}

.hero-image--no-border {
  border: none;
  box-shadow: none;
  background: transparent;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.hero-image-placeholder {
  width: 80%;
  max-width: 1000px;
  height: 356px;
  margin: 16px auto 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

/* 内容区 */
.content-section {
  max-width: 1000px;
  margin: 80px auto;
  padding: 0 20px;
}

.content-section h2 {
  font-size: 32px;
  font-weight: 600;
  line-height: 48px;
  margin: 0 0 20px 0;
  color: var(--text-dark);
}

.content-section h3 {
  font-size: 24px;
  font-weight: 500;
  line-height: 36px;
  margin: 0 0 16px 0;
  color: var(--text-dark);
}

.content-section p {
  font-size: 16px;
  font-weight: 300;
  line-height: 28.8px;
  margin: 0 0 24px 0;
  color: var(--text-dark);
}

/* ShowCases 引用样式 */
.showcase-quote {
  margin: 0;
  margin-top: 8px;
  padding-left: 20px;
  border-left: 4px solid var(--border);
  font-size: 16px;
  font-weight: 300;
  line-height: 28.8px;
  color: var(--text-secondary);
}

.showcase-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(24, 30, 37, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}

.showcase-card .showcase-quote {
  margin-top: 0;
  padding-left: 0;
  border-left: 0;
}

.showcase-card .showcase-demo {
  margin-top: 16px;
}

.showcase-media {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  background: #fff;
}

.prompt-intro {
  margin: 6px 0 10px;
  color: var(--text-secondary);
}

.prompt-list {
  margin: 0 0 4px 0;
  padding-left: 20px;
}

.prompt-list li {
  margin: 8px 0;
}

.showcase-quote code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(24, 30, 37, 0.1);
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-dark);
}

.showcase-demo {
  margin-top: 24px;
}

.showcase-iframe {
  width: 100%;
  max-width: 960px;
  height: 540px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  display: block;
  background: #fff;
}

/* Showcases：移动端 iframe 不要固定 540px（会显得“又长又挤”） */
@media (max-width: 768px) {
  .showcase-iframe {
    height: 420px;
  }
}

@media (max-width: 520px) {
  .showcase-card {
    padding: 12px;
  }

  .prompt-list {
    padding-left: 16px;
  }

  .showcase-card .showcase-demo {
    margin-top: 12px;
  }

  .showcase-iframe {
    height: 360px;
    max-height: 70vh;
    border-radius: 14px;
  }

  /* demo3 这种“全屏 WebGL + 多个 fixed 控件”的 demo，需要更高的可视区域 */
  .showcase-iframe.showcase-iframe--tall {
    height: 560px;
    max-height: 82vh;
  }
}

/* LoopCoder 性能对比 */
.section-loop .section-header {
  margin-bottom: 18px;
}

.section-loop .section-intro {
  margin: 10px 0 0;
  color: var(--text-secondary);
}

.section-loop .loop-comparison-intro {
  margin-top: 16px;
}

.performance-comparison {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.comparison-item {
  border-radius: 14px;
  border: 1px solid rgba(24, 30, 37, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  padding: 14px;
}

.comparison-item h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  line-height: 1.3;
}

.comparison-demo {
  margin-top: 10px;
}

.comparison-iframe {
  width: 100%;
  height: 420px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  display: block;
  background: #fff;
}

@media (max-width: 900px) {
  .performance-comparison {
    grid-template-columns: 1fr;
  }

  .comparison-iframe {
    height: 360px;
  }
}

/* 手机端：给虫洞 demo 多一点可视高度，避免 UI 被挤压 */
@media (max-width: 520px) {
  .comparison-item {
    padding: 12px;
  }

  .comparison-iframe {
    height: 420px;
    max-height: 78vh;
  }
}

.content-section .list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
}

.feature-grid {
  list-style: none;
  padding: 0;
  margin: 24px 0 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(24, 30, 37, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 200ms ease,
    border-color 200ms ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 30, 37, 0.16);
  box-shadow: var(--shadow-lift);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: rgba(247, 248, 250, 0.85);
  border: 1px solid rgba(24, 30, 37, 0.08);
  color: var(--primary);
}

.feature-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-dark);
}

.feature-desc {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.content-section .list li {
  font-size: 16px;
  font-weight: 300;
  line-height: 28.8px;
  margin-bottom: 16px;
  padding-left: 24px;
  position: relative;
}

.content-section .list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 500;
}

.bg-light {
  background: var(--bg-light);
  padding: 60px 20px;
  border-radius: 12px;
  margin: 80px auto;
  max-width: 1000px;
}

/* 占位图块 */
.img-placeholder {
  width: 100%;
  height: 260px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--white);
  font-size: 14px;
}

/* 表格 */
.spec-table-wrap {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.spec-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
  background: transparent;
  min-width: 780px;
}

.spec-table th,
.spec-table td {
  border: none;
  border-bottom: 1px solid rgba(24, 30, 37, 0.1);
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}

.spec-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-dark);
  font-weight: 600;
  border-bottom: 1px solid rgba(24, 30, 37, 0.14);
}

.spec-table tr:hover {
  background: rgba(24, 30, 37, 0.03);
}

/* 路径：用“步骤 → 步骤”展示 */
.path-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.path-step {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.path-arrow {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1;
}

.spec-table td:last-child .path-flow {
  max-width: 520px;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 10px 16px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 0;
}

/* Layout：让 footer 在路由内容较短时也能始终贴住视口底部 */
.layout-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.layout-main {
  flex: 1 0 auto;
}

.layout-shell .footer {
  margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 20px;
  }

  .logo {
    height: 48px;
  }

  .hero h1 {
    font-size: 36px;
    line-height: 54px;
  }

  .content-section {
    max-width: 100%;
    padding: 0 20px;
  }

  .content-section h2 {
    font-size: 24px;
    line-height: 36px;
  }

  .hero-image-placeholder {
    width: 100%;
    height: 240px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}
