/* =============================================================
 * features.css —— 族谱功能页专属样式
 * 数据来源：Figma 设计稿 node 471:1834 (Slide 16:9 - 16)
 * 说明：
 *   1. body 背景灰色 #D9D9D9（与其他功能块之间的 25px 间距露出）。
 *   2. 7 个功能模块各自带背景图，背景固定在各自模块内。
 *   3. 每个模块采用不同入场动效（基于 animate.css + wow.js）。
 * ============================================================= */

/* ---------- 1. 整页容器 ---------- */
.page-features {
  width: 100%;
  background: #D9D9D9;        /* 整体灰色背景 */
  position: relative;
  padding-bottom: 25px;       /* 底部与 footer 间距 */
}

/* =============================================================
 * 区块一：Banner（与首页相同，但去除搜索框）
 * Figma 469:283 1920x960 height: 0~960px
 * ============================================================= */
.features-banner {
  position: relative;
  width: 100%;
  height: 550px;
  background: url('../image/banner-bg.png') center/cover no-repeat;
  overflow: hidden;
}


/* 9 个 SVG 文字图（与首页一致） */
.features-banner .banner-words {
  position: absolute;
  left: 50%;
  top: 150px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 80px;                    /* 组间距 */
}
.features-banner .word-group {
  display: flex;
  align-items: center;
  gap: 10px;                     /* 组内字间距（与首页一致） */
}
.features-banner .word-item {
  height: 150px;
  max-width: 150px;
  width: auto;
  display: block;
}

/* Banner 下方副标题 */
.features-banner .banner-subtitle {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translateX(-50%);
  color: #000;
  text-align: center;
  font-family: "Noto Serif SC";
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  line-height: 72px;
  letter-spacing: 16px;
  margin: 0;
  white-space: nowrap;
}

/* =============================================================
 * 7 个功能区块通用样式
 * 共同的：相对定位、宽 100%、背景图铺满（cover）、25px 间距
 * 独有的：aspect-ratio 用作高度（来自 Figma 原图比例）
 * ============================================================= */
.features-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 25px;                    /* 25px 间距，露出灰色 body 背景 */
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  position: relative;
  width: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  overflow: hidden;
}

/* ---- 内容通用样式 ---- */
.feature-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 标题：功能① + 识证录谱
 * Figma 469:407 类标题：功能编号 36px 红 #B81C22，标题 48px 黑色 Noto Serif SC Black
 */
.feature-title {
  position: absolute;
  left: 20%;
  transform: translateX(-50%);
  top: 286px;                   /* 标题距功能区块顶部位置 */
  font-family: var(--font-serif);
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  z-index: 2;
}
.feature-title .num {
  color: var(--color-accent);
  font-size: 36px;
  font-weight: 700;
  margin-right: 20px;
}
.feature-title .name {
  color: #000;
  font-family: "Noto Serif SC";
  font-weight: 900;             /* Black */
  font-size: 48px;
  font-style: normal;
  line-height: normal;
    letter-spacing: 3px;
}

/* 诗句：Noto Serif SC Bold 32px black, leading 63px, 居中 */
.feature-poem {
  position: absolute;
  left: 20%;
  transform: translateX(-50%);
  top: 360px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  color: #000;
  text-align: center;
  line-height: 63px;
  white-space: nowrap;
  z-index: 2;
}
.feature-poem p { margin: 0; }

/* 内容图（手机、人物、产品等） */
.feature-img {
  position: absolute;
  z-index: 1;
  display: block;
}
.feature-img-2 { z-index: 2; }   /* 功能3 第二张图需要在第一张之上 */

/* 右下角红色高亮装饰（SVG，83x83） */
.feature-highlight {
  position: absolute;
  right: 300px;
top: 198px;
width: 60px;
height: 60px;
  z-index: 3;
  cursor: pointer;
  transition: transform .3s ease;
}
.feature-highlight:hover {
  transform: scale(1.12);
}

/* =============================================================
 * 功能 ① — 识证录谱
 * Figma 469:282 1920x1482 (top 985)
 * 标题 top 1223 诗 top 1437 内容图 top 1442 1668x847
 * ============================================================= */
.feature-1 {
    aspect-ratio: 1920 / 1100;
    background-image: url(../image/feat1-bg.png);
    background-size: 100% 100%;
}
.feature-1 .feature-title { top: 185px; }
.feature-1 .feature-poem { top: 400px; }
.feature-1 .feature-img {
  left: 124px;
    top: 74px;
  max-width: 80%;
  height: auto;
}

/* =============================================================
 * 功能 ② — 智绘先容
 * Figma 469:411 1920x1357 (top 2490)
 * 标题 top 2703 诗 top 2917 内容图 469:415 763x901 top 2798
 * ============================================================= */
.feature-2 {
  aspect-ratio: 1920 / 1100;
  background-image: url('../image/feat2-bg.png');
    background-size: 100% 100%;
}
.feature-2 .feature-title { top: 185px; }
.feature-2 .feature-poem { top: 400px; }
.feature-2 .feature-img {
  left: 39.74%;                 /* 763/1920 = 39.74% */
  top: 22.69%;                  /* 308/1357 = 22.69% */
  width: 18%;                /* 396/1920 */
}
.feature-2 .feature-img-br {
  right: 0;
  bottom: 0;
  top: auto;
  left: auto;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* =============================================================
 * 功能 ③ — 一键成谱
 * Figma 469:419 1918x1356 (top 3872)
 * 标题 top 4111 诗 top 4325
 * 内容图 469:421 519x673 top 4213 left 700
 * 内容图 469:420 856x789 top 4439 left 1064
 * ============================================================= */
.feature-3 {
  aspect-ratio: 1920 / 1100;
  background-image: url('../image/feat3-bg.png');
    background-size: 100% 100%;
}
.feature-3 .feature-title { top: 185px; }
.feature-3 .feature-poem { top: 400px; }
.feature-3 .feature-img {
  left: 36.5%;                  /* 700/1918 = 36.5% */
  top: 25.15%;                  /* 341/1356 = 25.15% */
  width: 22%;                /* 519/1918 */
}
.feature-3 .feature-img-2 {
  left: 55.48%;                 /* 1064/1918 */
  top: 41.81%;                  /* 567/1356 */
  width: 44.63%;                /* 856/1918 */
}

/* =============================================================
 * 功能 ④ — 一脉相承
 * Figma 469:434 1921x1352 (top 5253)
 * 标题 top 5403 诗 top 5566
 * 无独立内容图（背景已包含全部视觉）
 * ============================================================= */
.feature-4 {
  aspect-ratio: 1920 / 1100;
  background-image: url('../image/feat4-bg.png');
    background-size: 100% 100%;
}
.feature-4 .feature-title { top: 162px; }
.feature-4 .feature-poem { top: 287px; }
.feature-4 .feature-img-4a {
  object-fit: contain;
    width: 100%;
    height: 100%;
}
.feature-4 .feature-img-4b {
  object-fit: contain;
    width: 100%;
    height: 100%;
}

/* =============================================================
 * 功能 ⑤ — 童承祖蕴
 * Figma 469:427 1919x1343 (top 6806, 含白色背景 6633)
 * 标题 top 6822 诗 top 6978 内容图 469:428 1919x1343 top 6806
 * ============================================================= */
.feature-5 {
  aspect-ratio: 1920 / 1100;
  background-color: #fff;       /* 内部白色背景 */
  background-image: url('../image/feat5-bg.png');
  background-size: cover;
    background-size: 100% 117%;
}
.feature-5 .feature-bg-deco {
  position: absolute;
  inset: 0;
  background: url('../image/feat5-bg.png') center/cover no-repeat;
  opacity: 0.18;
  z-index: 0;
}
.feature-5 .feature-title {
  top: 180px;
  z-index: 2;
}
.feature-5 .feature-poem { top: 310px; }

/* =============================================================
 * 功能 ⑥ — 影像资料库
 * Figma 469:442 1920x1316 (top 8174)
 * 标题 top 8325 内容图 469:443 1020x817 top 8458
 * 无诗
 * ============================================================= */
.feature-6 {
  aspect-ratio: 1920 / 1100;
  background-image: url('../image/feat6-bg.png');
    background-size: 100% 100%;
}
.feature-6 .feature-title {
  top: 180px;
}
.feature-6 .feature-img {
    left: 30.66%;
    top: 30%;
    width: 50%;
}

/* =============================================================
 * 功能 ⑦ — 数据统计
 * Figma 469:448 1920x1290 (top 9515)
 * 标题 top 9666 内容图 469:449 1409x402 top 9996
 * 无诗
 * ============================================================= */
.feature-7 {
  aspect-ratio: 1920 / 1100;
  background-image: url('../image/feat7-bg.png');
    background-size: 100% 100%;
}
.feature-7 .feature-title {
  top: 180px;
}
.feature-7 .feature-img {
    left: 12.23%;
    top: 34.29%;
    width: 76.39%;
}

/* =============================================================
 * 入场动效（每个模块差异化）
 * 由 animate.css 提供关键类，wow.js 触发
 * ============================================================= */
.wow { visibility: hidden; }

/* ----- 视频弹窗（全屏遮罩）----- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.video-modal.is-open {
  display: flex;
}
.video-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}
.video-modal-inner {
  position: relative;
  width: 90%;
  max-width: 960px;
  z-index: 1;
  animation: modalFadeIn .35s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .2s;
}
.video-modal-close:hover { opacity: 0.7; }
.video-modal-player {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
}

/* 响应式 */
@media (max-width: 768px) {
  .video-modal-inner {
    width: 95%;
  }
  .video-modal-close {
    top: -36px;
    font-size: 28px;
  }
}

/* 自定义：自下而上纱窗卷起效果 */
@keyframes rollDown {
  from { clip-path: inset(100% 0 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.animate__rollDown {
  animation-name: rollDown;
  animation-duration: 6s;
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;
}

/* =============================================================
 * 响应式 —— 平板（≤ 1200px）
 * ============================================================= */
@media (max-width: 1200px) {
  .features-banner { height: 520px; }
  .features-banner .banner-words { top: 200px; gap: 40px; }
  .features-banner .word-item { height: 90px; }
  .features-banner .banner-subtitle { font-size: 22px; line-height: 48px; letter-spacing: 10px; }

  .feature-title .num { font-size: 28px; }
  .feature-title .name { font-size: 36px; }
  .feature-poem { font-size: 22px; line-height: 44px; }
  .feature-highlight { width: 60px; height: 60px; right: 40px; top: 20px; }
}

/* =============================================================
 * 响应式 —— 手机（≤ 768px）
 * 关键改造：取消 aspect-ratio 与绝对定位，改为纵向流式布局，
 *           标题/诗句/内容图依次堆叠，避免 px 定位在窄屏溢出被裁切。
 * ============================================================= */
@media (max-width: 768px) {
  /* 防止入场动效（slideInRight/fadeInRight 横向平移）瞬态超出 */
  .page-features main { overflow-x: hidden; }

  .features-banner { height: 300px; }
  .features-banner .banner-words { top: 70px; gap: 14px; }
  .features-banner .word-group { gap: 4px; }
  .features-banner .word-item { height: 42px; max-width: 50px; }
  .features-banner .banner-subtitle {
    font-size: 13px;
    line-height: 24px;
    letter-spacing: 4px;
    top: auto;
    bottom: 28px;
    white-space: normal;
    width: 90%;
  }

  /* 功能区块：取消固定宽高比，按内容撑高 */
  .feature {
    aspect-ratio: auto !important;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 32px 16px 36px;
    background-size: cover !important;
    background-position: center top;
  }

  /* 标题：转为静态、居中、可换行 */
  .feature-title {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    text-align: center;
    white-space: normal;
  }
  .feature-title .num {
    display: block;
    font-size: 15px;
    margin-right: 0;
    margin-bottom: 6px;
  }
  .feature-title .name {
    font-size: 24px;
    letter-spacing: 2px;
  }

  /* 诗句：转为静态、居中、可换行 */
  .feature-poem {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    font-size: 16px;
    line-height: 30px;
    white-space: normal;
    text-align: center;
  }
  .feature-poem p { line-height: 30px; }

  /* 内容图：转为静态、居中、限高，避免巨图霸屏 */
  .feature-img,
  .feature-img-2,
  .feature-img-br,
  .feature-img-4a,
  .feature-img-4b {
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: 92%;
    max-height: 340px;
    margin: 0 auto;
    display: block;
    object-fit: contain;
  }

  /* 右上角红色装饰：缩小并保留在角落 */
  .feature-highlight {
    width: 34px;
    height: 34px;
    right: 12px;
    top: 12px;
  }
}

/* =============================================================
 * 响应式 —— 小手机（≤ 480px）
 * ============================================================= */
@media (max-width: 480px) {
  .features-banner { height: 260px; }
  .features-banner .banner-words { top: 60px; gap: 10px; }
  .features-banner .word-item { height: 34px; max-width: 42px; }
  .features-banner .banner-subtitle {
    font-size: 12px;
    letter-spacing: 3px;
    bottom: 22px;
  }

  .feature {
    min-height: 340px;
    padding: 26px 14px 30px;
    gap: 12px;
  }
  .feature-title .name { font-size: 21px; }
  .feature-poem { font-size: 15px; line-height: 28px; }
  .feature-poem p { line-height: 28px; }
  .feature-img,
  .feature-img-2,
  .feature-img-br,
  .feature-img-4a,
  .feature-img-4b {
    max-width: 94%;
    max-height: 300px;
  }
  .feature-highlight { width: 30px; height: 30px; right: 10px; top: 10px; }
}
