/* 
  SimWorld Landing Page Styles - 自适应媒体版本
  专门优化视频和图片的响应式显示
*/

/* === 基础重置 === */
:root { --nav-h: 70px; }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #2d3748;
  background: #ffffff;
  overflow-x: hidden;
}

html, body {
  scroll-snap-type: y mandatory;
  scroll-padding-bottom: 0;
}


.section-snap {
  scroll-snap-align: start;
}

/* === 容器系统 === */
.container {
  width: 100%;
  max-width: 1200px;   /* 保持你之前的最大宽度限制 */
  margin: 0 auto;
  padding: 0 20px;
  display: flex;       /* 弹性布局 */
  flex-direction: column;    /* 主轴改为纵向，从上到下 */
  justify-content: center; /* 水平居中 */
  align-items: center;     /* 垂直居中 */
}

/* === hero区域 === */
.hero-section {
  position: relative;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f6f9fc 0%, #e9f2ff 50%, #dce6f2 100%);
  overflow: hidden;
  will-change: transform, opacity;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.3);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: fadeInUp 1.2s ease-out;
  width: 100%;
  max-width: 1500px;
}

.hero-title {
  margin-bottom: 0.5rem;
}

.hero-title img {
  height: clamp(80px, 15vmin, 140px);
  width: auto;
  margin: 0 auto 1rem;
  display: block;
  filter: drop-shadow(2px 4px 4px rgba(0,0,0,0.1));
}

.hero-title h1 {
  font-size: clamp(1.5rem, 3.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin: 0;
}

/* === 英雄视频容器 - 完全自适应 === */
.hero-video-container {
  position: relative;
  width: min(90%, 1150px);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInScale 1.5s ease-out 0.3s both;
  
  /* 16:9 宽高比 */
  aspect-ratio: 16/9;
}

.hero-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* === 滚动指示器 === */
.scroll-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: bounce 2s infinite;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.scroll-indicator:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.scroll-indicator svg {
  width: 30px;
  height: 30px;
  fill: #4a5568;
  opacity: 0.7;
}

/* === 导航栏 === */
.nav-wrap{
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);                /* 在文档流中预留空间 */
  margin-bottom: calc(-1 * var(--nav-h));
}

.hero-nav{
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: transparent;             /* 在 Hero 上方时透明 */
  transition: background .3s ease, box-shadow .3s ease, backdrop-filter .3s ease;
  backdrop-filter: none;
  box-shadow: none;
}

/* 滚过 Hero 后加上白底与阴影 */
.hero-nav.scrolled{
  background: linear-gradient(135deg, #f6f9fc 0%, #e9f2ff 50%, #dce6f2 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}

/* 可选：给锚点/标题留出滚动对齐的顶边距，避免被粘顶导航遮住 */
section, [id]{
  scroll-margin-top: var(--nav-h);
}

/* === 内容区域 === */
.content-section {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
  padding: 80px 0;
}

.content-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === 全宽背景 === */
.full-width-bg {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.why-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.dynamic-section {
  background: #f8f9fa;
}

.actions-section {
  background: #f8f9fa;
}

.reasoning-section {
  background: #f8f9fa;
}

.citation-section {
  background: linear-gradient(135deg, #f6f9fc 0%, #e9f2ff 50%, #dce6f2 100%);
}

/* === 排版 === */
h2 {
  text-align: center;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  color: #2d3748;
}

h3 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.intro-text {
  max-width: 800px;
  margin: 0 auto 1rem;
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.8;
  color: #4a5568;
}

/* === 网格系统 === */
.features-grid{
  display:grid;
  grid-template-columns:1fr;      /* 默认：小屏单列 */
  gap: 1rem;
  margin: 1rem 0;
  align-items:stretch;            /* 卡片等高 */
}

/* >=768px：三列 */
@media (min-width:768px){
  .features-grid{
    grid-template-columns:repeat(3,1fr);
  }
}

/* 卡片样式（可按需微调） */
.feature-card{
  height:100%;
  padding:0.5rem 1.5rem;
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:12px;
  box-shadow:0 4px 16px rgba(0,0,0,.06);
  transition:transform .25s ease, box-shadow .25s ease;
  display:flex;                   /* 让内容在卡片内分布更稳 */
  flex-direction:column;
  gap:.5rem;
}

.feature-card:hover{
  transform:translateY(-4px);
  box-shadow:0 10px 28px rgba(0,0,0,.12);
}

.feature-card h3{ margin:0 0 .25rem; font-weight:600; color:#667eea; }

.feature-card p{ margin:0; color:#4a5568; line-height:1.7; }

/* 入场动画（防止JS未加载时被隐藏） */
.fade-in-left,
.fade-in-right,
.fade-in-up{
  opacity:1;                /* 如果你有 IntersectionObserver，会被覆盖为动画 */
  transform:none;
}

.comparison-grid{
  display: grid;
  grid-template-columns: 1fr;   /* 窄屏：1列 */
  gap: 3rem;
  align-items: start;
}

@media (min-width: 600px){
  .comparison-grid{
    grid-template-columns: repeat(2, 1fr); /* 宽屏：2列 */
  }
}

.video-grid{
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  grid-template-columns: 1fr;                 /* 默认：1 列 */
}

@media (min-width: 1200px){
  .video-grid{ grid-template-columns: repeat(2, 1fr); }  /* ≥1200px：2 列 */
}


/* === 视频卡片 === */
.video-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  background: white;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* === 媒体容器 - 完全自适应 === */
.media-container {
  margin: 2rem auto;
  max-width: 70%;
  border-radius: 12px;
  overflow: hidden;
}

.media-container img {
  width: 100vw;
  height: auto;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.marquee-container {
  /* margin: 2rem auto; */
  max-width: 100vw;
  border-radius: 12px;
  overflow: hidden;
}

.marquee-container img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.marquee {
  --speed: 19s;    /* 调整速度：越小越快 */
  --gap: 24px;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: var(--gap);
  width: max-content;
  animation: marquee-left var(--speed) linear infinite;
}

/* 图片：自适应高度，保持比例 */
.marquee-track img {
  height: 220px;   /* 你可以改，比如 200~320px */
  width: auto;
  flex-shrink: 0;
  display: block;
  object-fit: cover;   /* 对非等高素材友好 */
  border-radius: 8px;  /* 可选：单个缩略图圆角 */
}

/* 悬停暂停 */
.marquee:hover .marquee-track {
  animation-play-state: paused;
}

/* 左向无限滚动关键帧 */
@keyframes marquee-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); } /* 恰好滚动完一整组（队列 A 的总宽度） */
}

/* 减少动效偏好：停掉动画，展示静态第一屏 */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* 可选：两端做一点渐隐（更“跑马灯”） */
.marquee::before,
.marquee::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40px;          /* 渐隐宽度 */
  pointer-events: none;
  z-index: 2; 
}

.marquee::before {
  left: 0;
  background: linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,1));
}

.marquee::after {
  right: 0;
  background: linear-gradient(to left, rgba(255,255,255,1), rgba(255,255,255,0));
}

/* === 视频包装器 - 自适应宽高比 === */
.video-wrapper{
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.video-wrapper video{
  display: block;
  width: 100%;
  height: 100%;        /* 注意：父容器必须有确定高度（由 aspect-ratio 提供） */
  object-fit: cover;   /* 仍能裁剪铺满 */
  opacity: 0; transition: opacity .5s;
}

.video-wrapper video.loaded{ opacity: 1; }

/* === 单个视频容器 === */
.single-video-container {
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* === 表格 === */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.comparison-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  background: white;
  font-size: clamp(12px, 2vw, 14px);
}

.comparison-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.comparison-table th,
.comparison-table td {
  padding: clamp(0.5rem, 2vw, 1rem);
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.comparison-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.05);
}

.comparison-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.highlight-row {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%) !important;
  font-weight: 600;
}

/* === 概览图片 === */
.overview-image {
  margin: 1rem auto;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.overview-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* === 列表样式 === */
.comparison-list {
  list-style: none;
  padding: 0;
}

.comparison-list li {
  margin-bottom: 1rem;
  font-size: clamp(1rem, 2vw, 1.1rem);
  padding-left: 0;
}

/* === 引用区域 === */
.citation-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f5f5f5;
  border: 1px solid #cecece;
  border-radius: 6px;
  padding: 8px 10px;
  color: #ccc;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  z-index: 10;
}

.copy-btn:hover {
  background: #c4c4c4;
  color: #fff;
  border-color: #ffffff;
}

.copy-btn:active {
  transform: scale(0.95);
}

/* Code block styling */
.citation-container pre {
  margin: 0;
  padding: 2rem 2rem 1.5rem 2rem;
  background: #f8f9fa;
  overflow-x: auto;
  border-radius: 12px;
}

.citation-container code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: clamp(0.8rem, 1.5vw, 0.9rem);
  line-height: 1.7;
  color: #4a4a4a;
  white-space: pre;
  display: block;
}

/* Syntax highlighting for BibTeX */
#citation-code {
  color: #4a4a4a;
}

/* Success message */
.copy-success {
  position: absolute;
  top: 12px;
  right: 60px;
  background: #16a34a;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.copy-success.show {
  opacity: 1;
  transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .citation-container pre {
    padding: 2rem 1rem 1.5rem 1rem;
    font-size: 12px;
  }
  
  .copy-btn {
    top: 8px;
    right: 8px;
    padding: 6px 8px;
    font-size: 12px;
  }
  
  .copy-success {
    right: 50px;
    font-size: 11px;
  }
}