/* style/index.css */

/* 智能文字颜色选择器 - body背景色为深色，所以页面默认文字为浅色 */
.page-index {
  color: #FFF1E8; /* Text Main */
  background-color: #140C0C; /* Background */
}

.page-index__main-title {
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #FFF1E8; /* Text Main */
  text-align: center;
  margin-top: 40px;
  margin-bottom: 20px;
  max-width: 900px;
  font-size: clamp(28px, 4vw, 48px); /* H1 font size clamp for responsiveness */
}

.page-index__description {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #FFF1E8;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px auto;
}

/* 🚨 桌面端视频区域样式（必须严格遵守） */
.page-index__video-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  /* 🚨 页头整段高度由 shared 的 body { padding-top: var(--header-offset); }承担；此处仅用小额顶距，禁止再写 var(--header-offset) 以免双倍空白 */
  padding-top: 10px; 
  background-color: #140C0C; /* Background color for the section */
}

.page-index__video-container {
  position: relative;
  width: 100%; /* 🚨 桌面端必须包含 width: 100% */
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* 🚨 视频点击链接样式（必须严格遵守） */
.page-index__video-link {
  display: block;
  text-decoration: none;
  position: relative;
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-index__video-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-index__video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 宽高比 - 🚨 PageSpeed优化：固定宽高比 tránh layout shift (CLS) */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-index__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  object-fit: cover;
  pointer-events: none; /* 防止视频控件阻止点击事件 */
}

/* 🚨 视频点击提示遮罩层样式（可选，增强用户体验） */
.page-index__video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.page-index__video-link:hover .page-index__video-overlay {
  opacity: 1;
}

.page-index__video-click-hint {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  background: rgba(198, 31, 31, 0.8); /* Primary color with transparency */
  border-radius: 5px;
  white-space: nowrap;
}

/* 🚨 Play Now按钮样式（必须严格遵守，位于视频下方中间位置） */
.page-index__video-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
}

.page-index__play-now-button {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(180deg, #FFB04A 0%, #D86A14 100%); /* Button gradient */
  color: #FFF1E8; /* Text Main */
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
}

.page-index__play-now-button:hover {
  background: linear-gradient(180deg, #D86A14 0%, #FFB04A 100%); /* Inverted gradient on hover */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.page-index__play-now-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Module 2: Promo Dark Section */
.page-index__promo-dark {
  background: #2A1212; /* Card BG */
  padding: 24px 16px;
  color: #FFF1E8; /* Text Main */
}

.page-index__gifcode-tabs {
  max-width: 1250px;
  margin: 0 auto;
}

.page-index__gifcode-title {
  color: #C61F1F; /* Primary color */
  text-align: center;
  text-transform: uppercase;
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.page-index__gifcode-tab-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 16px 0 32px 0;
}

.page-index__gifcode-tab-nav a {
  color: #FFF1E8; /* Text Main */
  text-decoration: none;
  text-transform: uppercase;
  padding: 8px 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.page-index__gifcode-tab-nav a.is-active {
  color: #F3C54D; /* Gold */
  border-bottom-color: #F3C54D; /* Gold */
}

.page-index__gifcode-panel {
  display: none;
}

.page-index__gifcode-panel.is-active {
  display: block;
}

.page-index__gifcode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1250px;
  margin: 0 auto;
}

.page-index__gifcode-col {
  flex: 1 1 calc(50% - 6px); /* 2 columns for desktop */
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.page-index__gifcode-img {
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.page-index__gifcode-img img {
  display: block;
  width: 100%;
  aspect-ratio: 370 / 127; /* Fixed aspect ratio for consistency */
  object-fit: cover;
  transition: transform 0.3s;
}

.page-index__gifcode-img:hover img {
  transform: scale(1.03);
}

.page-index__blog-section-title {
  color: #F3C54D; /* Gold */
  text-align: center;
  margin: 40px 0 0;
  font-size: 1.1rem;
  text-transform: uppercase;
  font-weight: bold;
}

/* Module 3: Blog Slider */
.page-index__blog-slider {
  padding: 16px 0 32px;
  background: #140C0C; /* Background */
  color: #FFF1E8; /* Text Main */
}

.page-index__blog-slider-wrap {
  position: relative;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 40px;
}

.page-index__blog-slider-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -webkit-overflow-scrolling: touch;
}

.page-index__blog-slider-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.page-index__post-item {
  flex: 0 0 calc((100% - 64px) / 5); /* 5 cards visible for desktop */
  scroll-snap-align: start;
  min-width: 0;
  transition: transform 0.3s ease;
}

.page-index__post-item:hover {
  transform: translateY(-5px);
}

.page-index__post-box {
  position: relative;
  background: #2A1212; /* Card BG */
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page-index__post-image {
  position: relative;
}

.page-index__post-cover {
  position: relative;
  padding-top: 120px; /* Fixed height for cover image */
  overflow: hidden;
}

.page-index__post-cover-link {
  display: block;
  position: absolute;
  inset: 0;
}

.page-index__post-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-index__post-cover-link:hover img {
  transform: scale(1.05);
}

.page-index__post-text {
  padding: 12px;
  text-align: center;
  color: #FFF1E8; /* Text Main */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index__post-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-index__post-title a {
  color: #F3C54D; /* Gold */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-index__post-title a:hover {
  color: #FFB04A; /* Lighter gold */
}

.page-index__post-divider {
  width: 40px;
  height: 2px;
  background: #6A1E1E; /* Border color */
  margin: 8px auto;
}

.page-index__post-excerpt {
  color: #FFF1E8; /* Text Main */
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  opacity: 0.8;
}

.page-index__post-date {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #2A1212; /* Card BG */
  border: 2px solid #6A1E1E; /* Border color */
  padding: 4px 6px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  border-radius: 4px;
  color: #FFF1E8; /* Text Main */
  font-weight: bold;
}

.page-index__post-date-day {
  display: block;
  font-weight: 700;
  color: #F3C54D; /* Gold */
}

.page-index__post-date-month {
  display: block;
  font-size: 10px;
  color: #FFF1E8;
  text-transform: uppercase;
}

.page-index__blog-slider-prev,
.page-index__blog-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(42, 18, 18, 0.7); /* Card BG with transparency */
  border: 1px solid #6A1E1E; /* Border color */
  color: #FFF1E8; /* Text Main */
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.page-index__blog-slider-prev:hover,
.page-index__blog-slider-next:hover {
  background: #C61F1F; /* Primary color */
  color: #ffffff;
}

.page-index__blog-slider-prev { left: 0; }
.page-index__blog-slider-next { right: 0; }

/* 🚨 Mobile Responsive Design (max-width: 768px) */
@media (max-width: 768px) {
  .page-index__video-section {
    padding-top: 10px !important;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  .page-index__video-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden !important;
  }
  
  .page-index__video-link {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .page-index__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 4px;
    overflow: hidden !important;
  }
  
  .page-index__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 4px;
    object-fit: contain; /* 移动端使用contain确保视频完整显示且不超出 */
  }
  
  .page-index__video-cta {
    margin-top: 20px;
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .page-index__play-now-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }
  
  .page-index__video-click-hint {
    font-size: 14px !important;
    padding: 8px 16px !important;
  }

  .page-index__main-title {
    font-size: clamp(24px, 6vw, 36px);
    margin-top: 20px;
    margin-bottom: 15px;
    padding: 0 10px;
  }

  .page-index__description {
    font-size: 1rem;
    margin-bottom: 40px;
    padding: 0 10px;
  }

  /* GifCode Tabs Mobile */
  .page-index__gifcode-row {
    flex-direction: column;
    gap: 10px;
  }

  .page-index__gifcode-col {
    flex: 1 1 100%; /* Single column for mobile */
    gap: 10px;
  }

  .page-index__gifcode-tab-nav {
    gap: 15px;
    margin-bottom: 20px;
  }

  /* Blog Slider Mobile */
  .page-index__blog-slider-wrap {
    padding: 0 15px;
  }

  .page-index__blog-slider-prev,
  .page-index__blog-slider-next {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  /* Ensure all images are responsive in mobile */
  .page-index img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-index__post-item {
    flex: 0 0 100%; /* 1 card visible for mobile */
  }

  .page-index__post-cover {
    padding-top: 100px; /* Slightly reduced height for mobile */
  }

  .page-index__post-title {
    font-size: 1rem;
  }

  .page-index__post-excerpt {
    font-size: 0.8rem;
  }
}

@media (max-width: 849px) and (min-width: 550px) {
  .page-index__post-item {
    flex: 0 0 calc((100% - 32px) / 3); /* 3 cards visible for tablet */
  }
}

@media (max-width: 549px) {
  .page-index__post-item {
    flex: 0 0 100%; /* 1 card visible for small mobile */
  }
  .page-index__blog-slider-prev, .page-index__blog-slider-next {
    display: flex; /* Always show arrows for single card scroll */
  }
}