/* =========================================================
   小忆智能助手 · 下载落地页样式
   设计令牌遵循 docs/coding-standards.md §8
   ========================================================= */

:root {
  --primary: #8A63F5;
  --primary-light: #B79BF8;
  --primary-soft: #F1EEFD;
  --primary-grad: linear-gradient(135deg, #8A63F5 0%, #B79BF8 100%);
  --text: #1F2937;
  --text-sub: #6B7280;
  --text-mute: #9CA3AF;
  --border: rgba(138, 99, 245, 0.08);
  --white-80: rgba(255, 255, 255, 0.85);
  --radius-card: 20px;
  --maxw: 1280px;
  --font-cn: "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Inter", "SF Pro Display", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-cn), var(--font-en);
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ===================== 导航 ===================== */
.glass-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white-80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}
.glass-nav.scrolled { box-shadow: 0 4px 20px rgba(138, 99, 245, 0.08); }

.nav-inner {
  height: 64px;
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 80px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; justify-self: start; }
.brand-logo { border-radius: 9px; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--text); }

.nav-links { display: flex; gap: 32px; justify-self: center; margin: 0; }
.nav-actions { justify-self: end; }
.nav-link {
  position: relative;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-sub);
  padding: 4px 0;
  transition: color 0.2s ease;
}
.nav-link:hover { color: var(--primary); }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.2s ease;
}
.nav-link:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 12px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 9999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-icon {
  width: 18px; height: 18px;
  margin-right: 6px;
  fill: currentColor;
  flex-shrink: 0;
}
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(138, 99, 245, 0.25);
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(138, 99, 245, 0.35);
}
.btn-ghost {
  background: #fff;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-ghost:hover {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
}
.btn-solid {
  background: var(--primary-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(138, 99, 245, 0.25);
}
.btn-solid:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(138, 99, 245, 0.35);
}
.btn-disabled {
  background: #fff;
  color: var(--text-mute);
  border-color: #E5E7EB;
  cursor: not-allowed;
}

/* 汉堡菜单 */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端折叠菜单 */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 12px 32px 20px;
  background: var(--white-80);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { padding: 10px 0; font-size: 16px; }
.mobile-menu .mobile-login { margin-top: 8px; }

/* ===================== Hero ===================== */
.hero {
  position: relative;
  overflow: visible;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(183, 155, 248, 0.18), transparent 60%),
    linear-gradient(180deg, #fff 0%, #F7F5FE 100%);
  padding: 80px 0 90px;
}
body { overflow-x: hidden; }
.hero-glow {
  position: absolute;
  width: 520px; height: 520px;
  right: -6%; top: 6%;
  background: radial-gradient(circle, rgba(138, 99, 245, 0.16) 0%, rgba(183, 155, 248, 0.05) 55%, transparent 72%);
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "top visual"
    "bottom visual";
  /* 第二行用 1fr 兜底：跨两行的手机模型会把多余高度摊到两个 auto 行上，
     导致桌面端 CTA 被整体下移 ~110px（移动端拆分 hero 带来的副作用） */
  grid-template-rows: auto 1fr;
  align-content: start;
  align-items: start;
  gap: 0 48px;
}
.hero-text-top { grid-area: top; }
.hero-visual { grid-area: visual; }
.hero-text-bottom { grid-area: bottom; }
.hero-text-top,
.hero-text-bottom {
  max-width: 560px;
  text-align: left;
  position: relative;
}
/* 不额外加外边距：grid item 不会与子元素 margin 折叠，
   加多少就会多撑开多少，桌面端 CTA 位置会偏离原设计 */
.hero-text-bottom { margin-top: 0; }
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 54px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
}
.gradient-text {
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-sub);
  margin-top: 16px;
  text-align: left;
}
.hero-desc {
  font-size: 17px;
  font-weight: 500;
  color: var(--text-sub);
  margin: 12px 0 0;
  max-width: 480px;
  text-align: left;
}
.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 14px;
  margin-top: 30px;
}
.btn-disabled-wrap { position: relative; display: inline-flex; }
.ios-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #1F2937;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.ios-tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1F2937;
}
.btn-disabled-wrap:hover .ios-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.hero-badges {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 22px;
  list-style: none;
  margin-top: 28px;
}
.hero-badges li {
  position: relative;
  font-size: 14px;
  color: var(--text-sub);
  padding-left: 20px;
}
.hero-badges li::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* 手机模型（无刘海 / 窄边框） */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.hero-watermark {
  position: absolute;
  top: 62%; left: -5%;
  transform: translateY(-50%) rotate(-10deg);
  font-size: 10rem;
  font-weight: 800;
  letter-spacing: -5px;
  line-height: 1;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.07;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: -1;
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}
.phone-float { animation: phoneFloat 4s ease-in-out infinite; }
.phone-frame {
  width: 280px; height: auto;
  aspect-ratio: 390 / 844;
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.65);
  padding: 6px;
  box-shadow: 0 30px 60px -15px rgba(138, 99, 245, 0.22),
              0 0 0 1px rgba(138, 99, 245, 0.08),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  position: relative;
  z-index: 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.phone-screen {
  width: 100%; height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.phone-screen img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* ===================== 通用 section ===================== */
.section-title {
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
}
.section-sub {
  font-size: 16px;
  color: var(--text-sub);
  text-align: center;
  margin-top: 10px;
}

/* ===================== 功能卖点 ===================== */
.features { padding: 90px 0; background: #fff; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.feature-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  transition: all 0.25s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(138, 99, 245, 0.12);
  border-color: rgba(138, 99, 245, 0.25);
}
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--primary-grad);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg {
  width: 26px; height: 26px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-sub); line-height: 1.7; }

/* ===================== 截图展示 ===================== */
.screenshots { padding: 90px 0; background: linear-gradient(180deg, #F7F5FE 0%, #fff 100%); }
.screenshot-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 64px;
  margin-top: 56px;
}
.shot-item { margin: 0; text-align: center; }
.shot-item:hover .phone-frame {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -15px rgba(138, 99, 245, 0.22),
              0 0 0 1px rgba(138, 99, 245, 0.08),
              inset 0 0 0 1px rgba(255, 255, 255, 0.6),
              0 16px 40px rgba(138, 99, 245, 0.12);
}
.shot-item--center:hover .phone-frame { transform: translateY(-18px); }
.shot-item--center .phone-frame {
  width: 300px; height: auto;
  aspect-ratio: 390 / 844;
  transform: translateY(-12px);
}
.shot-label { margin-top: 14px; }
.shot-label .t { display: block; font-size: 14px; font-weight: 600; color: #374151; }
.shot-label .d { display: block; font-size: 12px; color: var(--text-mute); margin-top: 2px; }

/* 移动端横向滚动（统一自定义滚动条 §8.4） */
.custom-scrollbar::-webkit-scrollbar { height: 6px; width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.06); border-radius: 9999px; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #C4B5F7; border-radius: 9999px;
  border: 2px solid transparent; background-clip: padding-box;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--primary); border: 2px solid transparent; background-clip: padding-box;
}
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: #C4B5F7 rgba(0, 0, 0, 0.06); }

.screenshot-scroll {
  display: flex;
  gap: 36px;
  overflow-x: auto;
  padding: 8px 8px 24px;
  margin-top: 40px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.screenshot-scroll > .shot-item { flex: 0 0 auto; scroll-snap-align: center; }

/* ===================== Footer ===================== */
.footer { background: #111827; color: #E5E7EB; padding: 56px 0 28px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; gap: 14px; max-width: 460px; }
.footer-logo { border-radius: 8px; }
.footer-name { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.footer-slogan { font-size: 14px; color: #9CA3AF; line-height: 1.7; }
.footer-cols { display: flex; gap: 64px; }
.footer-col h4 { font-size: 15px; color: #fff; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14px; color: #9CA3AF; padding: 5px 0; transition: color 0.2s ease; }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px; color: #6B7280;
}
.footer-bottom a {
  color: inherit;
  text-decoration: none;
}
.footer-bottom a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}
.beian-links {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.beian-links .beian-ga {
  display: inline-flex; align-items: center; gap: 5px;
}
.beian-links .beian-ga img {
  width: 14px; height: 14px; display: block;
}

/* ===================== 响应式 ===================== */
.hidden-mobile { display: flex; }
.mobile-only { display: none; }

@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "top"
      "visual"
      "bottom";
    grid-template-rows: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: left;
  }
  .hero-visual { order: 0; }
  .hero-title { font-size: 46px; }
  .hero-text-bottom { margin-top: 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-watermark { font-size: 6.5rem; left: 0; top: 60%; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }

  /* ① 系统名称一行显示；② 去掉汉堡按钮，登录按钮直接放右上角 */
  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
  }
  .nav-links { display: none; }
  .brand { flex-shrink: 0; min-width: 0; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-name { white-space: nowrap; font-size: 16px; }
  .nav-actions { gap: 0; margin-left: auto; flex-shrink: 0; }
  .nav-actions .btn-ghost { display: inline-flex; padding: 7px 16px; font-size: 14px; }
  .hamburger { display: none; }
  .mobile-menu { display: none !important; }

  /* ④ 标题 + 文案在图片上方，图片在文案与按钮之间 */
  .hero { padding: 24px 0 48px; }
  .hero-inner { gap: 18px; }
  .badge { font-size: 12px; padding: 5px 12px; margin-bottom: 14px; }
  .hero-title { font-size: 26px; white-space: normal; }
  .hero-sub { font-size: 15px; margin-top: 10px; line-height: 1.45; }
  .hero-desc { font-size: 13px; margin-top: 6px; line-height: 1.55; }
  .hero-text-bottom { margin-top: 0; }

  /* ③ 下载按钮：单个撑满整行；将来 iOS 入口放开后自动变等宽两列 */
  .cta-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 16px;
  }
  .cta-group > * { min-width: 0; }
  /* 包裹层只负责占位，不参与尺寸，否则会把按钮挤矮 */
  .cta-group .btn-disabled-wrap {
    width: 100%;
    min-height: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
  }
  .cta-group .btn,
  .cta-group .btn-disabled-wrap .btn {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .cta-group .btn-icon { width: 16px; height: 16px; margin-right: 5px; }
  .hero-badges { margin-top: 16px; justify-content: center; gap: 14px; font-size: 12px; }

  .phone-frame { width: 190px; height: auto; aspect-ratio: 390 / 844; border-radius: 26px; padding: 4px; }
  .phone-screen { border-radius: 22px; }
  /* 手机浮动幅度调小，避免上浮时压到上方文案 */
  .phone-float { animation: phoneFloatMobile 4s ease-in-out infinite; }
  @keyframes phoneFloatMobile {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
  }
  .shrink-center { transform: none; }
  .shot-item--center .phone-frame { width: 240px; height: auto; aspect-ratio: 390 / 844; transform: none; }
  .hero-watermark { font-size: 4.5rem; left: 0; top: 65%; opacity: 0.05; }

  .feature-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 28px; }
  .hidden-mobile { display: none; }
  .mobile-only { display: flex; }
  .custom-scrollbar::-webkit-scrollbar { height: 4px; }
  .screenshot-scroll { gap: 28px; }
  .footer-inner { flex-direction: column; gap: 28px; }
  .footer-cols { gap: 40px; }
}
