/* ============================================================
   模板 4 样式 —— 全屏分段滚动叙事 + 右侧圆点 rail
   配套模板：src/templates/user/4.njk
   与 1（顶栏纵堆）/ 2（左栏 Bento）/ 3（时间轴 zigzag）换骨：
   每章占满一屏（100vh）/ 全宽色块交替 / 右侧圆点 rail / v4- 独立类名
   配色由 sk.palette 注入 :root（无 palette 时用下方默认工业蓝）
   ============================================================ */

:root {
  --primary: #1456b8;
  --primary-dark: #0e3f8a;
  --accent: #f5a623;
  --bg-soft: #f4f7fb;
  --footer-bg: #16202e;
  --text: #1f2937;
  --text-soft: #5b6675;
  --border: #e5e9f0;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(17, 24, 39, 0.09);
  --container: 1100px;
}

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

.v4-body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: #fff;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---------------- 顶部悬浮品牌栏（极简透明，不遮挡内容） ---------------- */
.v4-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 100%);
  pointer-events: none;
}
.v4-topbar > * { pointer-events: auto; }
.v4-brand {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
}
.v4-topbar-tel {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ---------------- 右侧圆点 rail 导航 ---------------- */
.v4-rail {
  position: fixed;
  right: clamp(14px, 2.5vw, 32px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: flex-end;
}
.v4-rail-dot {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.7);
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}
/* 浅色章节里的圆点变深色 */
.v4-rail-dot.on-light {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(0, 0, 0, 0.3);
}
.v4-rail-dot.is-active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
}
/* 悬浮时显示标签 */
.v4-rail-label {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  text-shadow: none;
}
.v4-rail-dot:hover .v4-rail-label { opacity: 1; }

/* ---------------- 全屏 scroller 容器 ---------------- */
.v4-scroller {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  scroll-behavior: smooth;
}

/* ---------------- 章节通用 ---------------- */
.v4-chapter {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
}
/* 背景色交替：偶数章节用 bg-soft */
.v4-bg-alt {
  background: var(--bg-soft);
}
.v4-chapter-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 100px) clamp(20px, 5vw, 48px);
}

/* 章节头部：序号 + 标题 */
.v4-chapter-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(28px, 5vh, 52px);
}
.v4-chapter-no {
  flex: none;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  opacity: 0.7;
}
.v4-chapter-title {
  font-size: clamp(24px, 3.6vw, 38px);
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-bottom: 10px;
}
.v4-chapter-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.v4-chapter-sub {
  color: var(--text-soft);
  font-size: 15px;
  margin-top: 8px;
}

/* ================= 首屏 Hero ================= */
.v4-chapter-hero {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  text-align: center;
}
.v4-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.v4-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.65), rgba(15, 23, 42, 0.35));
  z-index: 1;
}
.v4-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  /* 文字浮层不拦截轮播箭头/圆点点击 */
  pointer-events: none;
}
.v4-hero-content a { pointer-events: auto; }
.v4-hero-eyebrow {
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 20px;
}
.v4-hero-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.3);
}
.v4-hero-sub {
  font-size: clamp(16px, 2.2vw, 22px);
  opacity: 0.92;
  margin-bottom: 28px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
.v4-hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}
.v4-hero-tags li {
  font-size: 14px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}
.v4-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2px;
  animation: v4-fade-bounce 2.2s ease-in-out infinite;
}
@keyframes v4-fade-bounce {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(6px); }
}

/* ---------------- 按钮 ---------------- */
.v4-btn {
  display: inline-block;
  font-weight: 700;
  padding: 14px 36px;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.v4-btn:hover { transform: translateY(-2px); }
.v4-btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.2);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 40%, transparent);
}
.v4-btn-light {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.12);
}

/* ---------------- 背景轮播：图片按宽铺满、高度随比例 ---------------- */
.v4-carousel { position: relative; width: 100%; height: 100%; }
.v4-carousel-track { position: relative; width: 100%; height: 100%; }
.v4-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}
.v4-slide.is-active { opacity: 1; }
/* 首屏 hero 恒为 100vh 全屏、图片 cover：object-position:center 保证超出部分对称居中裁切（与 1/2/3.njk 一致） */
.v4-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.v4-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v4-carousel-arrow:hover { background: rgba(255, 255, 255, 0.3); }
.v4-carousel-arrow.prev { left: 20px; }
.v4-carousel-arrow.next { right: 20px; }
.v4-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 80px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.v4-carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s ease, width 0.2s ease;
}
.v4-carousel-dot.is-active {
  width: 26px;
  border-radius: 5px;
  background: var(--accent);
}

/* ================= 段落型 prose ================= */
.v4-prose {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
  max-width: 820px;
  white-space: pre-line;
}
.v4-prose + .v4-prose { margin-top: 16px; }
.v4-about-local { font-size: 15px; }

/* about 图文两栏（全宽章节可放两栏） */
.v4-about {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 400px);
  gap: 48px;
  align-items: center;
}
.v4-about .v4-prose { max-width: none; margin: 0; }
.v4-about-card img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (max-width: 820px) {
  .v4-about { grid-template-columns: 1fr; gap: 24px; }
  .v4-about-card { max-width: 320px; }
}

/* ================= 指标 stats ================= */
.v4-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.v4-stat {
  flex: 1 1 180px;
  max-width: 240px;
  text-align: center;
  padding: 32px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.v4-stat-value {
  display: block;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}
.v4-stat-label {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 15px;
}

/* ================= 产品 products ================= */
.v4-prod {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.v4-prod-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.v4-prod-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(17, 24, 39, 0.14); }
.v4-prod-img { aspect-ratio: 4 / 3; background: var(--bg-soft); overflow: hidden; }
.v4-prod-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.v4-prod-card:hover .v4-prod-img img { transform: scale(1.05); }
.v4-prod-name {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* ================= 问答 faq ================= */
.v4-faq {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.v4-faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.v4-faq-q { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.v4-faq-a { font-size: 15px; color: var(--text-soft); }

/* ================= 流程 process ================= */
.v4-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.v4-flow-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.v4-flow-no {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.v4-flow-title { font-weight: 700; font-size: 16px; }
.v4-flow-desc { color: var(--text-soft); font-size: 14px; margin-top: 4px; }

/* ================= 卡片型 advantages / pain / cases ================= */
.v4-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.v4-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.v4-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(17, 24, 39, 0.14); }
.v4-card-idx {
  display: block;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 8px;
}
.v4-card-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.v4-card-desc { font-size: 14.5px; color: var(--text-soft); }

/* ================= 尾部 CTA + 页脚合一 ================= */
.v4-chapter-final {
  background: linear-gradient(135deg, var(--primary-dark), var(--footer-bg));
  color: #fff;
  text-align: center;
  min-height: auto;
  padding: clamp(60px, 10vh, 100px) 20px;
  scroll-snap-align: end;
}
.v4-final-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.v4-final-text {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  margin-bottom: 24px;
}
.v4-final-foot {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  max-width: 600px;
}
.v4-final-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.v4-final-desc { font-size: 14px; opacity: 0.75; margin-bottom: 12px; }
.v4-final-copy { font-size: 13px; opacity: 0.5; }
.v4-final-sites { margin-top: 14px; font-size: 13px; opacity: 0.62; line-height: 1.9; }
.v4-final-sites a { color: #fff; text-decoration: underline; }

/* ================= 响应式 ================= */
@media (max-width: 768px) {
  .v4-rail { display: none; }
  .v4-topbar-tel { font-size: 12px; padding: 6px 12px; }
  .v4-chapter-inner { padding: 50px 16px; }
  .v4-chapter-head { gap: 12px; margin-bottom: 24px; }
  .v4-chapter-no { font-size: 28px; }
  .v4-carousel-arrow { width: 36px; height: 36px; font-size: 20px; }
  .v4-carousel-arrow.prev { left: 10px; }
  .v4-carousel-arrow.next { right: 10px; }
  .v4-flow { grid-template-columns: 1fr; }
  .v4-cards { grid-template-columns: 1fr; }
}
