/* ============================================================
   黑龙排练室 官网 · 全局样式
   设计规范见 README 第八节（UI 设计规范，M2 定稿）
   白绿渐变简约 + 手绘风装饰 + 非对称大气布局
   ============================================================ */

:root {
  --green: #2E7D32;        /* 主色（与 App 一致） */
  --green-dark: #1B5E20;   /* hover/强调 */
  --green-light: #E8F5E9;  /* 区块底色 */
  --ink: #1A1A1A;          /* 正文 */
  --ink-2: #616161;        /* 次级文字 */
  --bg: #FFFFFF;
  --bg-alt: #FAFAFA;
  --serif: Georgia, 'Noto Serif SC', 'Songti SC', SimSun, serif;
  --sans: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, 'SF Mono', Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(46, 125, 50, 0.08);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06); }

.nav-inner {
  /* 贴边布局：不设 max-width，内容直达页面左右边缘 */
  padding: 0 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
.brand-logo { width: 40px; height: 40px; border-radius: 10px; }
.brand-name { font-weight: 700; font-size: 19px; }

.nav-links { display: flex; gap: 34px; }
.nav-links a {
  text-decoration: none;
  color: var(--ink-2);
  font-size: 16px;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--green); }
.nav-links a.active { color: var(--green); font-weight: 600; }

/* ---------- Hero（谱面特写式：左谱面 + 右文字，贴边布局） ---------- */
.hero {
  max-width: 1360px;
  margin: 0 auto;
  padding: 90px 48px 100px;
}

/* 漂浮音符装饰（手绘风 SVG） */
.float-note {
  position: absolute;
  color: var(--green);
  opacity: 0.1;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  animation: heroIn 1s ease-out both;
}
.float-note svg { display: block; width: 100%; height: auto; }
.float-note.n1 { top: 8%;   left: -1%;  width: 120px; transform: rotate(-14deg); animation-delay: 0.4s; }
.float-note.n2 { bottom: 6%; left: 5%;   width: 96px;  transform: rotate(10deg);  animation-delay: 0.6s; }
.float-note.n3 { top: 18%;  right: 2%;  width: 76px;  transform: rotate(18deg);  animation-delay: 0.5s; }
.float-note.n4 { bottom: 12%; right: 9%; width: 62px;  transform: rotate(-8deg);  animation-delay: 0.7s; }

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 56px;
}

/* 左列：谱面（纸面直接呈现，不做整体淡入，符号在其上逐笔描画） */
.staff-hero {
  flex: 1.2;
  min-width: 0;
  width: 100%;
  height: auto;
}

/* ---------- 谱面手绘描画动画（pathLength 归一化 + 纯 CSS animation） ----------
   .draw-path = 描边类（谱号/拍号/符干/连线）：
     path 元素加 pathLength="1" 归一化长度 → dasharray/dashoffset 恒为 1，
     animation 把 dashoffset 从 1 画到 0，线条从起点"生长"到终点（从无到有）。
     --d   = animation-delay（手绘顺序，逐个起笔）
     --dur = animation-duration（按笔画长度手调，短笔快、长笔慢）
   .fade-path = 填充类（符头）：opacity 0 → 1 渐显（填充图形不受 dash 动画控制） */
.staff-hero .draw-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: staffDraw var(--dur, 1.2s) cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes staffDraw {
  to { stroke-dashoffset: 0; }
}

.staff-hero .fade-path {
  opacity: 0;
  animation: staffFade 0.45s ease-out forwards;
  animation-delay: var(--d, 0s);
}
@keyframes staffFade {
  to { opacity: 1; }
}

/* 右列：文字（左对齐） */
.hero-text { flex: 1; min-width: 0; text-align: left; }

.hero-title {
  font-family: var(--serif);
  font-size: clamp(44px, 5.5vw, 68px);
  font-weight: 700;
  letter-spacing: 5px;
  line-height: 1.15;
  /* 白绿渐变文字（呼应 App 标题） */
  background: linear-gradient(120deg, #1A1A1A 20%, var(--green) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: heroIn 0.9s 0.3s ease-out both;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: clamp(20px, 2.4vw, 26px);
  color: var(--green);
  letter-spacing: 8px;
  animation: heroIn 0.9s 0.45s ease-out both;
}

.hero-desc {
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 17px;
  max-width: 460px;
  animation: heroIn 0.9s 0.6s ease-out both;
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: heroIn 0.9s 0.75s ease-out both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 16px 42px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}
.btn-primary {
  background: linear-gradient(120deg, var(--green-dark), var(--green));
  color: #fff;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(46, 125, 50, 0.4); }
.btn-outline {
  border: 2px solid var(--green);
  color: var(--green);
  background: transparent;
}
.btn-outline:hover { background: var(--green-light); transform: translateY(-2px); }

/* ---------- 通用章节（标题左对齐 + 手绘竖线装饰） ---------- */
.section-title {
  font-family: var(--serif);
  font-size: 38px;
  text-align: left;
  letter-spacing: 3px;
  line-height: 1.2;
  display: flex;
  align-items: center;
}
/* 标题前手绘竖线（圆头粗线，像手写的强调线） */
.section-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 30px;
  border-radius: 3px;
  background: var(--green);
  margin-right: 18px;
}
.section-subtitle {
  text-align: left;
  color: var(--ink-2);
  margin-top: 12px;
  margin-left: 23px;
  font-size: 16px;
}

/* ---------- 功能区 ---------- */
.features {
  max-width: 1360px;
  margin: 0 auto;
  padding: 80px 48px;
}

.feature-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  position: relative;
  background: var(--bg-alt);
  border: 1px solid rgba(46, 125, 50, 0.12);
  border-radius: 20px;
  padding: 36px 30px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}
/* 偶数卡片下移，形成错落排布 */
.feature-card:nth-child(even) { margin-top: 26px; }
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 34px rgba(46, 125, 50, 0.12);
  background: #fff;
}
/* hover 时右上角浮现手绘音符角标 */
.feature-card::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 16px;
  width: 26px;
  height: 26px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%232E7D32' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 42 C 13 48, 22 50, 25 44 C 27 39, 21 36, 18 38 C 15 40, 16 41, 16 42 Z'/%3E%3Cpath d='M21 40 L 28 10'/%3E%3Cpath d='M28 11 C 32 13, 35 17, 34 22'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}
.feature-card:hover::after { opacity: 0.6; transform: translateY(0); }

.feature-icon {
  width: 52px;
  height: 52px;
  color: var(--green);
}
.feature-icon svg { width: 100%; height: 100%; }
.feature-card h3 { margin-top: 18px; font-size: 21px; color: var(--green-dark); letter-spacing: 1px; }
.feature-card p { margin-top: 10px; font-size: 15.5px; color: var(--ink-2); }

/* ---------- 截图区 ---------- */
.shots {
  max-width: 1360px;
  margin: 0 auto;
  padding: 60px 48px 90px;
}
.shot-placeholder {
  margin-top: 44px;
  height: 380px;
  border: 2px dashed rgba(46, 125, 50, 0.25);
  border-radius: 22px;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 16px;
  letter-spacing: 3px;
}

/* ---------- CTA（两栏：左文案 + 右按钮） ---------- */
.cta {
  max-width: 1360px;
  margin: 0 auto;
  padding: 80px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--green-light), #fff);
  border-radius: 26px;
}
.cta-text h2 {
  font-family: var(--serif);
  font-size: 38px;
  letter-spacing: 3px;
}
.cta-text p { color: var(--ink-2); margin-top: 12px; font-size: 17px; }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 70px;
  padding: 40px 32px 48px;
  color: var(--ink-2);
  font-size: 14px;
  border-top: 1px solid rgba(46, 125, 50, 0.08);
}
.footer a { color: var(--green); text-decoration: none; }
.footer .icp { margin-top: 6px; opacity: 0.75; }

/* 页脚终止线（手绘 SVG，"全曲终"） */
.footer-coda {
  max-width: 1360px;
  margin: 0 auto 24px;
  color: rgba(27, 94, 32, 0.45);
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-contact a { font-weight: 600; }

/* ---------- 滚动渐入动画 ----------
   渐进增强：默认可见（无 JS 时内容正常显示）；
   JS 启动后给 .reveal 加 .pre 进入隐藏态，由观察器控制显隐 */
.reveal { transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.pre { opacity: 0; transform: translateY(26px); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- 移动端适配 ---------- */
@media (max-width: 820px) {
  .hero { padding: 60px 20px 70px; }
  .hero-inner { flex-direction: column; gap: 30px; }
  .hero-text { text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .section-title, .section-subtitle { text-align: left; }
  .cta { padding: 48px 28px; flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  /* 移动端取消卡片错落，恢复整齐 */
  .feature-card:nth-child(even) { margin-top: 0; }
}

@media (max-width: 640px) {
  .nav-inner { height: 60px; padding: 0 20px; }
  .nav-links { gap: 20px; }
  .btn { padding: 14px 30px; font-size: 16px; }
  .section-title { font-size: 30px; }
  .features, .shots { padding-left: 20px; padding-right: 20px; }
}
